I am a very new zend framework and phpunit test learner. I have a zend project, I want to use the zend-test-phpunit to test the model and controllers under the application folder. How could I test it? I notice there is a tests folder in this project, and all the tests should be done in this folder? in this case, I have to copy all the controllers and model into this folder? who can provide me a example?
thank you for help in advance!
A good place to start is the Zend Framework documentation and PHPUnit manual: Chapter 3. Installing PHPUnit
You need to populate the
phpunit.xml
file with something along the lines of:Then it's just to run 'phpunit' from command line when in your test folder. If you want phpunit to produce a code coverage report, then you also need to enable xdebug in your environment