I recently began unit testing and have learned much about the capabilities and power that it can have. At work we have our own PHP database object that I began creating basic tests for.
The problem is that our application is meant to be supported on either a linux or a windows server. The plan is for our main server to run a continuous integration for our tests on the database object. This server is a linux server.
The main server obviously cannot have MSSQL on it so any test that involves MSSQL can't be properly run. The proposed solution that I have found was to mock my object to fake the calls and simply pass the result, but at the end of the day the mocked object does not test the database object's ability to actually interact with the database.
On one hand I understand the point of unit testing only the functionality of my object, such as whether or not it properly escapes a statement that is passed to it. On the other hand, however, I want to be able to test more complex functions such as the ability to rollback statements that haven't been committed yet.
What is the proper way to fully test my database object given that the server will not be able to run MSSQL?
Aucun commentaire:
Enregistrer un commentaire