I have a website and I need to do some unit tests before I push my development code into production.
I was thinking of coding some unit tests, but instead of sending back fake database data to the unit tests, using an actual MySQL database.
However, I'd want the test MySQL database to stay relatively static. That is, after a page is done loading, I would want the MySQL database to undo any queries that modified data, such as INSERT, UPDATE, etc. That way the database is reset to its old data and ready for the next test.
- Is there an easy way to implement this idea? Or should I take another approach?
- What are some of the common industry practices for testing websites that are heavily reliant on MySQL queries?