Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed Shell naming from using Inflector::underscore() to Inflector::c…

…amelize(). Added small test case for Shell naming. Fixed missing CakePlugin::load() call in ShellTest.
  • Loading branch information...
commit a80d82e4a054d494db74311a211e62335e20cb89 1 parent 85c505f
@tPl0ch tPl0ch authored
View
2  lib/Cake/Console/Command/Task/TestTask.php
@@ -467,7 +467,7 @@ public function getOptionParser() {
public function getPath() {
$path = $this->path;
if (isset($this->plugin)) {
- $path = $this->_pluginPath($this->plugin) . 'tests' . DS;
+ $path = $this->_pluginPath($this->plugin) . 'Test' . DS;
}
return $path;
}
View
2  lib/Cake/Console/Shell.php
@@ -149,7 +149,7 @@ class Shell extends Object {
*/
function __construct($stdout = null, $stderr = null, $stdin = null) {
if ($this->name == null) {
- $this->name = Inflector::underscore(str_replace(array('Shell', 'Task'), '', get_class($this)));
+ $this->name = Inflector::camelize(str_replace(array('Shell', 'Task'), '', get_class($this)));
}
$this->Tasks = new TaskCollection($this);
View
14 lib/Cake/Test/Case/Console/Command/ShellTest.php
@@ -172,6 +172,7 @@ public function testInitialize() {
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
), true);
+ CakePlugin::load('TestPlugin');
$this->Shell->uses = array('TestPlugin.TestPluginPost');
$this->Shell->initialize();
@@ -799,4 +800,17 @@ function testWrapText() {
TEXT;
$this->assertEquals($expected, $result, 'Text not wrapped.');
}
+
+/**
+ * Testing camel cased naming of tasks
+ *
+ * @access public
+ * @return void
+ */
+ public function testShellNaming() {
+ $this->Shell->tasks = array('TestApple');
+ $this->Shell->loadTasks();
+ $expected = 'TestApple';
+ $this->assertEqual($expected, $this->Shell->TestApple->name);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.