Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

2.0 Shell - Wrong underscore naming of Shells and Tasks #103

Merged
merged 1 commit into from

2 participants

@tPl0ch

Fixed Shell naming from using Inflector::underscore() to Inflector::camelize(). Added small test case for Shell naming. Fixed missing CakePlugin::load() call in ShellTest.

@tPl0ch tPl0ch 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.
a80d82e
@ADmad ADmad closed this
@ADmad ADmad reopened this
@ADmad ADmad merged commit c5a2efc into cakephp:2.0
@tPl0ch tPl0ch referenced this pull request from a commit in tPl0ch/cakephp
@tPl0ch tPl0ch Addition to pull request #103. Added plugin unloading to shell test c…
…ase.
14c291b
@zoghal zoghal referenced this pull request from a commit in zoghal/cakephp
@jrbasso jrbasso Using @property to autocomplete components and helpers in some IDEs. …
…Also added @property to bake of controller and model. Fixes #103.
d84531d
@m1nd53t m1nd53t referenced this pull request from a commit in m1nd53t/cakephp
@jrbasso jrbasso Using @property to autocomplete components and helpers in some IDEs. …
…Also added @property to bake of controller and model. Fixes #103.
1bfc3f6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 29, 2011
  1. @tPl0ch

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

    tPl0ch authored
    …amelize(). Added small test case for Shell naming. Fixed missing CakePlugin::load() call in ShellTest.
This page is out of date. Refresh to see the latest.
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);
+ }
}
Something went wrong with that request. Please try again.