Dispatcher =& new TestControllerTaskMockShellDispatcher(); $this->Task =& new MockControllerTask($this->Dispatcher); $this->Task->Dispatch =& new $this->Dispatcher; $this->Task->Dispatch->shellPaths = Configure::read('shellPaths'); $this->Task->Template =& new TemplateTask($this->Task->Dispatch); $this->Task->Model =& new ControllerMockModelTask($this->Task->Dispatch); } /** * tearDown method * * @return void * @access public */ function endTest() { unset($this->Task, $this->Dispatcher); ClassRegistry::flush(); } /** * test ListAll * * @return void **/ function testListAll() { $this->Task->connection = 'test_suite'; $this->Task->interactive = true; $this->Task->expectAt(1, 'out', array('1. Articles')); $this->Task->expectAt(2, 'out', array('2. ArticlesTags')); $this->Task->expectAt(3, 'out', array('3. Comments')); $this->Task->expectAt(4, 'out', array('4. Tags')); $expected = array('Articles', 'ArticlesTags', 'Comments', 'Tags'); $result = $this->Task->listAll('test_suite'); $this->assertEqual($result, $expected); $this->Task->expectAt(6, 'out', array('1. Articles')); $this->Task->expectAt(7, 'out', array('2. ArticlesTags')); $this->Task->expectAt(8, 'out', array('4. Comments')); $this->Task->expectAt(9, 'out', array('5. Tags')); $this->Task->interactive = false; $result = $this->Task->listAll(); $expected = array('articles', 'articles_tags', 'comments', 'tags'); $this->assertEqual($result, $expected); } } ?>