public function testRunWithTestOtherCommand() { $create = new MockCreate(array('request' => $this->request)); $this->request->params = array('command' => 'create', 'action' => 'run', 'args' => array('test', 'something', 'Post'), 'library' => 'create_test'); $create->run('test', 'something'); $expected = 'test'; $result = $create->request->params['command']; $this->assertEqual($expected, $result); $result = $this->_testPath . '/create_test/tests/cases/something/PostTest.php'; $this->assertTrue(file_exists($result)); }
public function testRunAll() { $this->request->params = array('library' => 'create_test', 'command' => 'create', 'action' => 'Posts', 'args' => array()); $create = new MockCreate(array('request' => $this->request)); $create->run('Posts'); $result = $this->_testPath . '/create_test/models/Posts.php'; $this->assertTrue(file_exists($result)); $result = $this->_testPath . '/create_test/controllers/PostsController.php'; $this->assertTrue(file_exists($result)); $result = $this->_testPath . '/create_test/tests/cases/models/PostsTest.php'; $this->assertTrue(file_exists($result)); $result = $this->_testPath . '/create_test/tests/cases/controllers/PostsControllerTest.php'; $this->assertTrue(file_exists($result)); }