mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Correct TestTask tests
there will not be a setUp function for Controller tests there will not be a tearDown there will be no returned constructor logic from generateConstructor all because for a controller test - you'd ordinarilly just call this->testAction
This commit is contained in:
parent
b509bdb04b
commit
a56ec8d6cf
1 changed files with 6 additions and 6 deletions
|
@ -468,12 +468,12 @@ class TestTaskTest extends CakeTestCase {
|
|||
$this->assertContains("App::uses('TestTaskCommentsController', 'Controller')", $result);
|
||||
$this->assertContains('class TestTaskCommentsControllerTest extends ControllerTestCase', $result);
|
||||
|
||||
$this->assertContains('function setUp()', $result);
|
||||
$this->assertContains("\$this->TestTaskComments = new TestTaskCommentsController()", $result);
|
||||
$this->assertContains("\$this->TestTaskComments->constructClasses()", $result);
|
||||
$this->assertNotContains('function setUp()', $result);
|
||||
$this->assertNotContains("\$this->TestTaskComments = new TestTaskCommentsController()", $result);
|
||||
$this->assertNotContains("\$this->TestTaskComments->constructClasses()", $result);
|
||||
|
||||
$this->assertContains('function tearDown()', $result);
|
||||
$this->assertContains('unset($this->TestTaskComments)', $result);
|
||||
$this->assertNotContains('function tearDown()', $result);
|
||||
$this->assertNotContains('unset($this->TestTaskComments)', $result);
|
||||
|
||||
$this->assertContains("'app.test_task_article'", $result);
|
||||
$this->assertContains("'plugin.test_task.test_task_comment'", $result);
|
||||
|
@ -550,7 +550,7 @@ class TestTaskTest extends CakeTestCase {
|
|||
*/
|
||||
public function testGenerateConstructor() {
|
||||
$result = $this->Task->generateConstructor('controller', 'PostsController', null);
|
||||
$expected = array('', "new PostsController();\n", "\$this->Posts->constructClasses();\n");
|
||||
$expected = array('', '', '');
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$result = $this->Task->generateConstructor('model', 'Post', null);
|
||||
|
|
Loading…
Reference in a new issue