diff --git a/src/Console/Command/Task/TestTask.php b/src/Console/Command/Task/TestTask.php index 9fb692f51c0..f1127ac753b 100644 --- a/src/Console/Command/Task/TestTask.php +++ b/src/Console/Command/Task/TestTask.php @@ -512,6 +512,7 @@ public function getOptionParser() { 'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.') ])->addOption('force', [ 'short' => 'f', + 'boolean' => true, 'help' => __d('cake_console', 'Force overwriting existing files without prompting.') ])->addOption('fixtures', [ 'help' => __d('cake_console', 'A comma separated list of fixture names you want to include.') diff --git a/src/Console/Templates/default/classes/test.ctp b/src/Console/Templates/default/classes/test.ctp index ad3d8fa08b5..fadccabeedc 100644 --- a/src/Console/Templates/default/classes/test.ctp +++ b/src/Console/Templates/default/classes/test.ctp @@ -16,6 +16,7 @@ */ use Cake\Utility\Inflector; +$isController = strtolower($type) === 'controller'; echo " namespace \Test\TestCase\; @@ -23,7 +24,7 @@ namespace \Test\TestCase\; use ; - + use Cake\TestSuite\ControllerTestCase; use Cake\TestSuite\TestCase; @@ -32,7 +33,7 @@ use Cake\TestSuite\TestCase; /** * Test Case */ - + class Test extends ControllerTestCase { class Test extends TestCase { diff --git a/tests/TestCase/Console/Command/Task/TestTaskTest.php b/tests/TestCase/Console/Command/Task/TestTaskTest.php index 79cd9fe22d2..5d669629d7a 100644 --- a/tests/TestCase/Console/Command/Task/TestTaskTest.php +++ b/tests/TestCase/Console/Command/Task/TestTaskTest.php @@ -384,7 +384,7 @@ public function testBakePrefixControllerTest() { ->method('createFile') ->will($this->returnValue(true)); - $result = $this->Task->bake('Controller', 'Admin\Posts'); + $result = $this->Task->bake('controller', 'Admin\Posts'); $this->assertContains("use TestApp\Controller\Admin\PostsController", $result); $this->assertContains('class PostsControllerTest extends ControllerTestCase', $result);