From 2a85ffe4954f48d97f962adf8776638c5ea138cb Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 29 Mar 2014 23:01:28 -0400 Subject: [PATCH] Expand test coverage for controller task. --- src/Console/Command/Task/ControllerTask.php | 2 +- .../Console/Command/Task/ControllerTaskTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Console/Command/Task/ControllerTask.php b/src/Console/Command/Task/ControllerTask.php index e86e42b3334..86bdae560ac 100644 --- a/src/Console/Command/Task/ControllerTask.php +++ b/src/Console/Command/Task/ControllerTask.php @@ -63,7 +63,7 @@ public function execute() { } if (empty($this->args)) { - $this->out(__d('cake_console', 'Possible Controllers based on your current database:')); + $this->out(__d('cake_console', 'Possible controllers based on your current database:')); foreach ($this->listAll() as $table) { $this->out('- ' . $this->_controllerName($table)); } diff --git a/tests/TestCase/Console/Command/Task/ControllerTaskTest.php b/tests/TestCase/Console/Command/Task/ControllerTaskTest.php index 155b47097dd..aee78b4c430 100644 --- a/tests/TestCase/Console/Command/Task/ControllerTaskTest.php +++ b/tests/TestCase/Console/Command/Task/ControllerTaskTest.php @@ -269,6 +269,22 @@ public function testBakeTestDisabled() { $this->Task->bakeTest('BakeArticles'); } +/** + * Test execute no args. + * + * @return void + */ + public function testExecuteNoArgs() { + $this->Task->expects($this->never()) + ->method('createFile'); + + $this->Task->expects($this->at(0)) + ->method('out') + ->with($this->stringContains('Possible controllers based on your current database')); + + $this->Task->execute(); + } + /** * test that execute runs all when the first arg == all *