Skip to content
Permalink
Browse files

Adding test cases for execute()

  • Loading branch information...
markstory committed May 30, 2009
1 parent 2b6ea87 commit b301654b968448865b78da422a4afeadd9d9be16
Showing with 26 additions and 0 deletions.
  1. +26 −0 cake/tests/cases/console/libs/tasks/test.test.php
@@ -390,5 +390,31 @@ function testMockClassGeneration() {
$result = $this->Task->hasMockClass('controller');
$this->assertTrue($result);
}
/**
* test execute with a type defined
*
* @return void
**/
function testExecuteWithOneArg() {
$this->Task->args[0] = 'Model';
$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');
$this->Task->setReturnValue('isLoadableClass', true);
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
$this->Task->execute();
}
/**
* test execute with type and class name defined
*
* @return void
**/
function testExecuteWithTwoArgs() {
$this->Task->args = array('Model', 'TestTaskTag');
$this->Task->setReturnValueAt(0, 'in', 'TestTaskTag');
$this->Task->setReturnValue('isLoadableClass', true);
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
$this->Task->execute();
}
}
?>

0 comments on commit b301654

Please sign in to comment.
You can’t perform that action at this time.