Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit a56ec8d6cf371684f65a88fc718611f3575f3786 1 parent b509bdb
@AD7six AD7six authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
View
12 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
@@ -468,12 +468,12 @@ public function testBakeControllerTest() {
$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 @@ public function testBakeHelperTest() {
*/
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);
Please sign in to comment.
Something went wrong with that request. Please try again.