mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding test cases for execute()
This commit is contained in:
parent
2b6ea8748c
commit
b301654b96
1 changed files with 26 additions and 0 deletions
|
@ -390,5 +390,31 @@ class TestTaskTest extends CakeTestCase {
|
|||
$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();
|
||||
}
|
||||
}
|
||||
?>
|
Loading…
Add table
Reference in a new issue