I am trying to test a CakePHP action that deals with a signup form secured with the Security
component. I have configured the component in a UsersController like th
The solution is to mock the Users
controller and the User
model and make expectations for the Security::_validatePost()
method:
$this->Users = $this->generate(
'Users',
array(
'components' => array(
'Security' => array('_validatePost'),
),
'models' => array('User' => true),
)
);
$this->Users->Security->expects($this->any())
->method('_validatePost')
->will($this->returnValue(true));