Skip to content
Permalink
Browse files

Make bake generate IntegrationTestCases.

ControllerTestCase is deprecated and will be going away. Bake should
generate tests using this new test class.

Refs #4592
  • Loading branch information...
markstory committed Sep 13, 2014
1 parent ab24722 commit 2a656c758e59169e33b45d2ea098312aa81d3ec6
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/Template/Bake/default/classes/test.ctp
  2. +2 −2 tests/TestCase/Shell/Task/TestTaskTest.php
@@ -25,7 +25,7 @@ namespace <?= $baseNamespace; ?>\Test\TestCase\<?= $subNamespace ?>;
use <?= $dependency; ?>;
<?php endforeach; ?>
<?php if ($isController): ?>
use Cake\TestSuite\ControllerTestCase;
use Cake\TestSuite\IntegrationTestCase;
<?php else: ?>
use Cake\TestSuite\TestCase;
<?php endif; ?>
@@ -34,7 +34,7 @@ use Cake\TestSuite\TestCase;
* <?= $fullClassName ?> Test Case
*/
<?php if ($isController): ?>
class <?= $className ?>Test extends ControllerTestCase {
class <?= $className ?>Test extends IntegrationTestCase {
<?php else: ?>
class <?= $className ?>Test extends TestCase {
<?php endif; ?>
@@ -385,7 +385,7 @@ public function testBakeControllerTest() {
$result = $this->Task->bake('Controller', 'PostsController');
$this->assertContains("use TestApp\Controller\PostsController", $result);
$this->assertContains('class PostsControllerTest extends ControllerTestCase', $result);
$this->assertContains('class PostsControllerTest extends IntegrationTestCase', $result);
$this->assertNotContains('function setUp()', $result);
$this->assertNotContains("\$this->Posts = new PostsController()", $result);
@@ -413,7 +413,7 @@ public function testBakePrefixControllerTest() {
$result = $this->Task->bake('controller', 'Admin\Posts');
$this->assertContains("use TestApp\Controller\Admin\PostsController", $result);
$this->assertContains('class PostsControllerTest extends ControllerTestCase', $result);
$this->assertContains('class PostsControllerTest extends IntegrationTestCase', $result);
$this->assertNotContains('function setUp()', $result);
$this->assertNotContains("\$this->Posts = new PostsController()", $result);

0 comments on commit 2a656c7

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