diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index cba5786ad..55e45f852 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -253,7 +253,7 @@ class Helper extends Object { $themePath = App::themePath($theme) . 'webroot' . DS . implode(DS, $segments); return $path . '?' . @filemtime($themePath); } else { - $plugin = $segments[0]; + $plugin = Inflector::camelize($segments[0]); unset($segments[0]); $pluginPath = App::pluginPath($plugin) . 'webroot' . DS . implode(DS, $segments); return $path . '?' . @filemtime($pluginPath); diff --git a/lib/Cake/tests/Case/View/HelperCollectionTest.php b/lib/Cake/tests/Case/View/HelperCollectionTest.php index a98fa88e2..4586bd8a0 100644 --- a/lib/Cake/tests/Case/View/HelperCollectionTest.php +++ b/lib/Cake/tests/Case/View/HelperCollectionTest.php @@ -44,6 +44,7 @@ class HelperCollectionTest extends CakeTestCase { * @return void */ function teardown() { + CakePlugin::unload(); unset($this->Helpers, $this->View); } @@ -82,6 +83,7 @@ class HelperCollectionTest extends CakeTestCase { $this->assertInstanceOf('HtmlAliasHelper', $result); App::build(array('plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS))); + CakePlugin::loadAll(); $result = $this->Helpers->load('SomeOther', array('className' => 'TestPlugin.OtherHelper')); $this->assertInstanceOf('OtherHelperHelper', $result); $this->assertInstanceOf('OtherHelperHelper', $this->Helpers->SomeOther); @@ -123,6 +125,7 @@ class HelperCollectionTest extends CakeTestCase { App::build(array( 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), )); + CakePlugin::loadAll(); $result = $this->Helpers->load('TestPlugin.OtherHelper'); $this->assertInstanceOf('OtherHelperHelper', $result, 'Helper class is wrong.'); $this->assertInstanceOf('OtherHelperHelper', $this->Helpers->OtherHelper, 'Class is wrong'); diff --git a/lib/Cake/tests/Case/View/HelperTest.php b/lib/Cake/tests/Case/View/HelperTest.php index 641a32828..ab39f83a4 100644 --- a/lib/Cake/tests/Case/View/HelperTest.php +++ b/lib/Cake/tests/Case/View/HelperTest.php @@ -216,6 +216,7 @@ class HelperTest extends CakeTestCase { * @return void */ function tearDown() { + CakePlugin::unload(); unset($this->Helper, $this->View); ClassRegistry::flush(); } @@ -520,6 +521,7 @@ class HelperTest extends CakeTestCase { 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS), )); + CakePlugin::loadAll(); $result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css'); $this->assertPattern('#/test_plugin/css/test_plugin_asset.css\?[0-9]+$#', $result, 'Missing timestamp plugin'); diff --git a/lib/Cake/tests/Case/View/ThemeViewTest.php b/lib/Cake/tests/Case/View/ThemeViewTest.php index 455f9ae86..1c7c99a9c 100644 --- a/lib/Cake/tests/Case/View/ThemeViewTest.php +++ b/lib/Cake/tests/Case/View/ThemeViewTest.php @@ -120,6 +120,7 @@ class ThemeViewTest extends CakeTestCase { 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS) )); + CakePlugin::loadAll(); } /** @@ -134,6 +135,7 @@ class ThemeViewTest extends CakeTestCase { unset($this->Controller); ClassRegistry::flush(); App::build(); + CakePlugin::unload(); } /** @@ -143,18 +145,18 @@ class ThemeViewTest extends CakeTestCase { * @return void */ function testPluginThemedGetTemplate() { - $this->Controller->plugin = 'test_plugin'; + $this->Controller->plugin = 'TestPlugin'; $this->Controller->name = 'TestPlugin'; $this->Controller->viewPath = 'tests'; $this->Controller->action = 'index'; $this->Controller->theme = 'test_theme'; $ThemeView = new TestThemeView($this->Controller); - $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'tests' . DS .'index.ctp'; + $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'TestPlugin' . DS . 'tests' . DS .'index.ctp'; $result = $ThemeView->getViewFileName('index'); $this->assertEqual($result, $expected); - $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'test_plugin' . DS . 'layouts' . DS .'plugin_default.ctp'; + $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'themed' . DS . 'test_theme' . DS . 'plugins' . DS . 'TestPlugin' . DS . 'layouts' . DS .'plugin_default.ctp'; $result = $ThemeView->getLayoutFileName('plugin_default'); $this->assertEqual($result, $expected); @@ -195,8 +197,8 @@ class ThemeViewTest extends CakeTestCase { $result = $ThemeView->getLayoutFileName(); $this->assertEqual($result, $expected); - $ThemeView->layoutPath = 'email' . DS . 'html'; - $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'layouts' . DS . 'email' . DS . 'html' . DS . 'default.ctp'; + $ThemeView->layoutPath = 'emails' . DS . 'html'; + $expected = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'layouts' . DS . 'emails' . DS . 'html' . DS . 'default.ctp'; $result = $ThemeView->getLayoutFileName(); $this->assertEqual($result, $expected); } diff --git a/lib/Cake/tests/test_app/View/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp b/lib/Cake/tests/test_app/View/themed/test_theme/plugins/TestPlugin/layouts/plugin_default.ctp similarity index 100% rename from lib/Cake/tests/test_app/View/themed/test_theme/plugins/test_plugin/layouts/plugin_default.ctp rename to lib/Cake/tests/test_app/View/themed/test_theme/plugins/TestPlugin/layouts/plugin_default.ctp diff --git a/lib/Cake/tests/test_app/View/themed/test_theme/plugins/test_plugin/tests/index.ctp b/lib/Cake/tests/test_app/View/themed/test_theme/plugins/TestPlugin/tests/index.ctp similarity index 100% rename from lib/Cake/tests/test_app/View/themed/test_theme/plugins/test_plugin/tests/index.ctp rename to lib/Cake/tests/test_app/View/themed/test_theme/plugins/TestPlugin/tests/index.ctp