I am working on a PHP (Zend Framework 1.12.1) application that ties into a database in a somewhat unique way.
Basically, we have an Oracle database that is a "black box" to me. I do not have privileges to select, update, insert, or delete any rows or tables directly. I have only been given access to database views (select only), and when I want to insert/update/delete data, I have to call one or more stored procedures. I have no idea what the actual table structures are, and I don't think anyone is going to give me access at any point.
All of this makes unit testing my models very difficult (not to mention writing them), as ZF seems to assume that your application has full privileges in the database. (This is why I have only done manual testing on my models so far, and my models are somewhat unusual.)
My application works, but I'm tired of manual testing.
Has anybody else been in this situation before? Can you recommend concrete steps to implement automated PHPUnit tests in an environment with limited database privileges? I have already asked the db admin to give me a stored procedure called resetTestData()
, which would allow me to run my tests beginning from a consistent state each time, but I am afraid ZF won't let me test using that stored procedure for set up and/or tear down. Apparently, Zend_Test_PHPUnit_DatabaseTestCase
attempts to truncate
the dataset before each test and then calls getDataSet()
to get the data and re-populate the database. Work around?