Category Archives: CakePHP

How to Unit Test a CakePHP Console (Shell) Command — An Example

Wow, it sure took me a long time to find an example of how to write a unit test for my CakePHP console (shell) commands. There’s no how-to in the CakePHP documentation, and the only blog post I could find … Continue reading

Posted in CakePHP, Testing | Leave a comment

CakePHP logoutRedirect is not the same as loginAction

If you go through the CakePHP Auth example tutorial, you’ll end up with two (not three) configuration settings in your AppController > components > Auth settings. They will look like this: public $components = array( ‘Session’, ‘Auth’ => array( ‘loginRedirect’ … Continue reading

Posted in CakePHP | Leave a comment

CakePHP Auth->allow only works on actions, not controllers

If you follow the CakePHP documentation on Authentication, you might end up with this line of code in your AppController.php file, in the beforeFilter() method. $this->Auth->allow(‘view’, ‘index’); … And that’s fine for demo purposes. But that actually allows all view() … Continue reading

Posted in CakePHP | Leave a comment