mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-17 15:09:50 +00:00
Updating TestTask tests
This commit is contained in:
parent
2be486844e
commit
233c050cea
1 changed files with 9 additions and 3 deletions
|
@ -258,6 +258,7 @@ class TestTaskTest extends CakeTestCase {
|
||||||
public function tearDown() {
|
public function tearDown() {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
unset($this->Task);
|
unset($this->Task);
|
||||||
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -525,11 +526,14 @@ class TestTaskTest extends CakeTestCase {
|
||||||
public function testBakeWithPlugin() {
|
public function testBakeWithPlugin() {
|
||||||
$this->Task->plugin = 'TestTest';
|
$this->Task->plugin = 'TestTest';
|
||||||
|
|
||||||
$path = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS .'FormHelperTest.php';
|
//fake plugin path
|
||||||
|
CakePlugin::load('TestTest', array('path' => APP . 'plugins' . DS . 'TestTest' . DS));
|
||||||
|
$path = APP . 'plugins' . DS . 'TestTest' . DS . 'tests' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS .'FormHelperTest.php';
|
||||||
$this->Task->expects($this->once())->method('createFile')
|
$this->Task->expects($this->once())->method('createFile')
|
||||||
->with($path, new PHPUnit_Framework_Constraint_IsAnything());
|
->with($path, new PHPUnit_Framework_Constraint_IsAnything());
|
||||||
|
|
||||||
$this->Task->bake('Helper', 'Form');
|
$this->Task->bake('Helper', 'Form');
|
||||||
|
CakePlugin::unload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -542,9 +546,10 @@ class TestTaskTest extends CakeTestCase {
|
||||||
App::build(array(
|
App::build(array(
|
||||||
'plugins' => array($testApp)
|
'plugins' => array($testApp)
|
||||||
), true);
|
), true);
|
||||||
|
CakePlugin::load('TestPlugin');
|
||||||
|
|
||||||
$this->Task->plugin = 'TestPlugin';
|
$this->Task->plugin = 'TestPlugin';
|
||||||
$path = $testApp . 'test_plugin' . DS . 'tests' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS . 'OtherHelperHelperTest.php';
|
$path = $testApp . 'TestPlugin' . DS . 'tests' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS . 'OtherHelperHelperTest.php';
|
||||||
$this->Task->expects($this->any())
|
$this->Task->expects($this->any())
|
||||||
->method('in')
|
->method('in')
|
||||||
->will($this->onConsecutiveCalls(
|
->will($this->onConsecutiveCalls(
|
||||||
|
@ -591,9 +596,10 @@ class TestTaskTest extends CakeTestCase {
|
||||||
$expected = $this->Task->path . 'Case' . DS . 'Controller' . DS . 'Component' . DS . 'AuthComponentTest.php';
|
$expected = $this->Task->path . 'Case' . DS . 'Controller' . DS . 'Component' . DS . 'AuthComponentTest.php';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
CakePlugin::load('TestTest', array('path' => APP . 'plugins' . DS . 'TestTest' . DS ));
|
||||||
$this->Task->plugin = 'TestTest';
|
$this->Task->plugin = 'TestTest';
|
||||||
$result = $this->Task->testCaseFileName('Model', 'Post');
|
$result = $this->Task->testCaseFileName('Model', 'Post');
|
||||||
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'Case' . DS . 'Model' . DS . 'PostTest.php';
|
$expected = APP . 'plugins' . DS . 'TestTest' . DS . 'tests' . DS . 'Case' . DS . 'Model' . DS . 'PostTest.php';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue