Dispatcher =& new ApiShellMockShellDispatcher(); $this->Shell =& new MockApiShell($this->Dispatcher); $this->Shell->Dispatch = new $this->Dispatcher; } /** * tearDown method * * @return void * @access public */ function endTest() { ClassRegistry::flush(); } /** * Test that method names are detected properly including those with no arguments. * * @access public * @return void */ function testMethodNameDetection () { $this->Shell->setReturnValueAt(0, 'in', 'q'); $this->Shell->expectAt(0, 'out', array('Controller')); $expected = array( array( '1. afterFilter()', '2. beforeFilter()', '3. beforeRender()', '4. constructClasses()', '5. disableCache()', '6. flash($message, $url, $pause = 1)', '7. header($status)', '8. isAuthorized()', '9. loadModel($modelClass = null, $id = null)', '10. paginate($object = null, $scope = array(), $whitelist = array())', '11. postConditions($data = array(), $op = null, $bool = \'AND\', $exclusive = false)', '12. redirect($url, $status = null, $exit = true)', '13. referer($default = null, $local = false)', '14. render($action = null, $layout = null, $file = null)', '15. set($one, $two = null)', '16. setAction($action)', '17. validate()', '18. validateErrors()' ) ); $this->Shell->expectAt(1, 'out', $expected); $this->Shell->args = array('controller'); $this->Shell->paths['controller'] = CAKE_CORE_INCLUDE_PATH . DS . LIBS . 'controller' . DS; $this->Shell->main(); } } ?>