I apologise in advance if this question is too subjective but I'm struggling to find a good answer, probably as there is not really a correct answer to give.
I'm currently writing a database abstraction layer to unify the use of a single API throughout my applications. Possibly re-inventing the wheel but I'm mainly doing it for my specific need of certain Oracle functionality that will eventually be migrated away from Oracle.
For the Oracle driver I'm finding it difficult to test the object due to the lack of an OO API in PHP, so to test I need to touch the database. There seems to be two schools of thought on testing database functionality.
- Don't touch the database, mock it all away (obviously impossible without an OO API).
- Allow the functionality to run and therefore feature test rather than unit test.
My question is two fold, has anyone done this before and how did you handle testing? If you haven't had cause to do this before, what are your thoughts on how you would handle it and why?