Beispiel #1
0
 public function generate($name, $mocks = array())
 {
     $authMock = array('components' => array('Auth' => array('user')));
     $mocks = array_merge_recursive($authMock, $mocks);
     $controller = parent::generate($name, $mocks);
     $controller->Auth->staticExpects($this->any())->method('user')->will($this->returnCallback(array($this, 'user')));
     return $controller;
 }