I'm trying to pull-of some tests for my RESTful api functions.
For this I did the following:
- Installed PHPUnit.
- Created a new database for testing.
- Created a new enviorment (test) and changed the doctrine config for it.
- Created a test.
My problem is this:
When performing a request (somedomain.com/api/somemethod) -> the requested page doesn't know i'm performing a test on it -> so the data it uses is the production/development database and not the 'test' db i have created for the tests.
(the script using test db, the requested page uses normal configurations).
Is there a way to solve it without touching or modifying the API code/behavior?.
Thanks.