October 2012
Beginner to intermediate
500 pages
10h 29m
English
![]()
Similar to the testing we did in Zend Framework, CakePHP’s unit tests depend on PHPUnit, making it an easy end to our time in CakePHP.
- We need to learn how to create and run tests on our controllers.
There are a few simple tests that we can create in order to validate the functionality of our CakePHP controllers. Because the majority of code we have written in CakePHP concerns the controller, we will only write tests for some of the actions in the UsersController.
CakePHP unit tests need to be placed n the ~/app/Test/ directory, and the first set of tests that we will create are shown in Listing 33-1 ...