Moving test plugins to the new naming convention> Now plugin names should be camel cased

This commit is contained in:
Jose Lorenzo Rodriguez 2011-04-29 12:49:46 -04:30
parent 46d994c3f0
commit f6a5df913a
62 changed files with 10 additions and 3 deletions

View file

@ -50,11 +50,18 @@ class CakePlugin {
return;
}
$config += array('bootstrap' => false, 'routes' => false);
$underscored = Inflector::underscore($plugin);
if (empty($config['path'])) {
foreach (App::path('plugins') as $path) {
if (is_dir($path . $plugin)) {
self::$_plugins[$plugin] = $config + array('path' => $path . $plugin . DS);
break;
}
//Backwards compatibility to make easier to migrate to 2.0
$underscored = Inflector::underscore($plugin);
if (is_dir($path . $underscored)) {
self::$_plugins[$plugin] = $config + array('path' => $path . $underscored . DS);
break;
}
}
} else {

View file

@ -181,10 +181,10 @@ class CakePluginTest extends CakeTestCase {
*/
public function testPath() {
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$expected = CAKE_TESTS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS;
$expected = CAKE_TESTS . 'test_app' . DS . 'plugins' . DS . 'TestPlugin' . DS;
$this->assertEquals(CakePlugin::path('TestPlugin'), $expected);
$expected = CAKE_TESTS . 'test_app' . DS . 'plugins' . DS . 'test_plugin_two' . DS;
$expected = CAKE_TESTS . 'test_app' . DS . 'plugins' . DS . 'TestPluginTwo' . DS;
$this->assertEquals(CakePlugin::path('TestPluginTwo'), $expected);
}