CakePHP 2.0

Testing Controllers in CakePHP 2.0

Posted by Jeremy Harris on Wed, Dec 15, 2010 @ 10:30pm

In the past, testing controllers in CakePHP always had its hiccups. In 2.0, testAction was written from the ground up to allow for mocking and an all-inclusive set of results.

To gain this new functionality, you'll need to do is extend your test case by ControllerTestCase instead of the typical CakeTestCaseControllerTestCase gives you access to two new methods, testAction and generate and se...