mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Moving test plugins to the new naming convention> Now plugin names should be camel cased
This commit is contained in:
parent
46d994c3f0
commit
f6a5df913a
62 changed files with 10 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Loading…
Reference in a new issue