Browse Source

Fixing incorrect theme paths for plugins, tests updated. Fixes #2099

Ceeram 14 years ago
parent
commit
981f40758c

+ 2 - 2
lib/Cake/Test/Case/View/ThemeViewTest.php

@@ -144,11 +144,11 @@ class ThemeViewTest extends CakeTestCase {
 		$this->Controller->theme = 'TestTheme';
 
 		$ThemeView = new TestThemeView($this->Controller);
-		$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
+		$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Tests' . DS .'index.ctp';
 		$result = $ThemeView->getViewFileName('index');
 		$this->assertEqual($expected, $result);
 
-		$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugins' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
+		$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Themed' . DS . 'TestTheme' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Layouts' . DS .'plugin_default.ctp';
 		$result = $ThemeView->getLayoutFileName('plugin_default');
 		$this->assertEqual($expected, $result);
 

+ 2 - 2
lib/Cake/Test/Case/View/ViewTest.php

@@ -248,7 +248,7 @@ class ViewTest extends CakeTestCase {
 		$paths = $View->paths('TestPlugin');
 		$pluginPath = CakePlugin::path('TestPlugin');
 		$expected = array(
-			CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugins' . DS . 'TestPlugin' . DS,
+			CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
 			$pluginPath . 'View' . DS,
 			$pluginPath . 'views' . DS,
 			$pluginPath . 'Lib' . DS . 'View' . DS,
@@ -412,7 +412,7 @@ class ViewTest extends CakeTestCase {
 
 		$result = $this->View->element('plugin_element', array(), array('plugin' => 'TestPlugin'));
 		$this->assertEqual($result, 'this is the plugin element using params[plugin]');
-		
+
 		$result = $this->View->element('plugin_element', array(), array('plugin' => 'test_plugin'));
 		$this->assertEqual($result, 'this is the plugin element using params[plugin]');
 

lib/Cake/Test/test_app/View/Themed/TestTheme/Plugins/TestPlugin/Layouts/plugin_default.ctp → lib/Cake/Test/test_app/View/Themed/TestTheme/Plugin/TestPlugin/Layouts/plugin_default.ctp


lib/Cake/Test/test_app/View/Themed/TestTheme/Plugins/TestPlugin/Tests/index.ctp → lib/Cake/Test/test_app/View/Themed/TestTheme/Plugin/TestPlugin/Tests/index.ctp


+ 2 - 2
lib/Cake/View/ThemeView.php

@@ -58,10 +58,10 @@ class ThemeView extends View {
 		if (!empty($this->theme)) {
 			$count = count($paths);
 			for ($i = 0; $i < $count; $i++) {
-				if (strpos($paths[$i], DS . 'Plugins' . DS) === false
+				if (strpos($paths[$i], DS . 'Plugin' . DS) === false
 					&& strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
 						if ($plugin) {
-							$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugins' . DS . $plugin . DS;
+							$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
 						}
 						$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
 					}

+ 1 - 1
lib/Cake/View/View.php

@@ -753,7 +753,7 @@ class View extends Object {
 			$count = count($viewPaths);
 			for ($i = 0; $i < $count; $i++) {
 				if (!isset($corePaths[$viewPaths[$i]])) {
-					$paths[] = $viewPaths[$i] . 'Plugins' . DS . $plugin . DS;
+					$paths[] = $viewPaths[$i] . 'Plugin' . DS . $plugin . DS;
 				}
 			}
 			$paths = array_merge($paths, App::path('View', $plugin));