Browse Source

Expand test coverage for controller task.

mark_story 12 years ago
parent
commit
2a85ffe495

+ 1 - 1
src/Console/Command/Task/ControllerTask.php

@@ -63,7 +63,7 @@ class ControllerTask extends BakeTask {
 		}
 
 		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));
 			}

+ 16 - 0
tests/TestCase/Console/Command/Task/ControllerTaskTest.php

@@ -270,6 +270,22 @@ class ControllerTaskTest extends TestCase {
 	}
 
 /**
+ * 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
  *
  * @return void