Browse Source

Rename templates/Layout to templates/layout.

ADmad 7 years ago
parent
commit
bcdfdc582a
27 changed files with 18 additions and 18 deletions
  1. 1 1
      src/View/View.php
  2. 0 0
      templates/layout/dev_error.php
  3. 17 17
      tests/TestCase/View/ViewTest.php
  4. 0 0
      tests/test_app/Plugin/Company/TestPluginThree/templates/layout/default.php
  5. 0 0
      tests/test_app/Plugin/TestPlugin/templates/layout/Email/text/plug_default.php
  6. 0 0
      tests/test_app/Plugin/TestPlugin/templates/layout/default.php
  7. 0 0
      tests/test_app/Plugin/TestPluginTwo/templates/layout/Email/text/default.php
  8. 0 0
      tests/test_app/Plugin/TestTheme/templates/Plugin/TestPlugin/layout/plugin_default.php
  9. 0 0
      tests/test_app/Plugin/TestTheme/templates/layout/default.php
  10. 0 0
      tests/test_app/templates/FooPrefix/BarPrefix/layout/default.php
  11. 0 0
      tests/test_app/templates/FooPrefix/layout/default.php
  12. 0 0
      tests/test_app/templates/FooPrefix/layout/nested_prefix_cascade.php
  13. 0 0
      tests/test_app/templates/layout/Email/html/default.php
  14. 0 0
      tests/test_app/templates/layout/Email/html/japanese.php
  15. 0 0
      tests/test_app/templates/layout/Email/html/thin.php
  16. 0 0
      tests/test_app/templates/layout/Email/text/default.php
  17. 0 0
      tests/test_app/templates/layout/Email/text/japanese.php
  18. 0 0
      tests/test_app/templates/layout/ajax.php
  19. 0 0
      tests/test_app/templates/layout/ajax2.php
  20. 0 0
      tests/test_app/templates/layout/banana.php
  21. 0 0
      tests/test_app/templates/layout/default.php
  22. 0 0
      tests/test_app/templates/layout/error.php
  23. 0 0
      tests/test_app/templates/layout/js/default.php
  24. 0 0
      tests/test_app/templates/layout/json/default.php
  25. 0 0
      tests/test_app/templates/layout/rss/default.php
  26. 0 0
      tests/test_app/templates/layout/with_flash.php
  27. 0 0
      tests/test_app/templates/layout/xml/default.php

+ 1 - 1
src/View/View.php

@@ -1326,7 +1326,7 @@ class View implements EventDispatcherInterface
         }
         list($plugin, $name) = $this->pluginSplit($name);
 
-        $layoutPaths = $this->_getSubPaths('Layout' . DIRECTORY_SEPARATOR . $subDir);
+        $layoutPaths = $this->_getSubPaths(static::TYPE_LAYOUT . DIRECTORY_SEPARATOR . $subDir);
 
         foreach ($this->_paths($plugin) as $path) {
             foreach ($layoutPaths as $layoutPath) {

templates/Layout/dev_error.php → templates/layout/dev_error.php


+ 17 - 17
tests/TestCase/View/ViewTest.php

@@ -349,24 +349,24 @@ class ViewTest extends TestCase
         $result = $ThemeView->getViewFileName('/Posts/index');
         $this->assertPathEquals($expected, $result);
 
-        $expected = Plugin::path('TestTheme') . 'templates' . DS . 'Layout' . DS . 'default.php';
+        $expected = Plugin::path('TestTheme') . 'templates' . DS . 'layout' . DS . 'default.php';
         $result = $ThemeView->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $ThemeView->setLayoutPath('rss');
-        $expected = TEST_APP . 'templates' . DS . 'Layout' . DS . 'rss' . DS . 'default.php';
+        $expected = TEST_APP . 'templates' . DS . 'layout' . DS . 'rss' . DS . 'default.php';
         $result = $ThemeView->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $ThemeView->setLayoutPath('Email' . DS . 'html');
-        $expected = TEST_APP . 'templates' . DS . 'Layout' . DS . 'Email' . DS . 'html' . DS . 'default.php';
+        $expected = TEST_APP . 'templates' . DS . 'layout' . DS . 'Email' . DS . 'html' . DS . 'default.php';
         $result = $ThemeView->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $ThemeView = new TestView(null, null, null, $viewOptions);
 
         $ThemeView->setTheme('Company/TestPluginThree');
-        $expected = Plugin::path('Company/TestPluginThree') . 'templates' . DS . 'Layout' . DS . 'default.php';
+        $expected = Plugin::path('Company/TestPluginThree') . 'templates' . DS . 'layout' . DS . 'default.php';
         $result = $ThemeView->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
     }
@@ -390,7 +390,7 @@ class ViewTest extends TestCase
         $result = $View->getViewFileName('index');
         $this->assertEquals($expected, $result);
 
-        $expected = Plugin::path('TestPlugin') . 'templates' . DS . 'Layout' . DS . 'default.php';
+        $expected = Plugin::path('TestPlugin') . 'templates' . DS . 'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertEquals($expected, $result);
     }
@@ -439,11 +439,11 @@ class ViewTest extends TestCase
         $result = $ThemeView->getViewFileName('index');
         $this->assertPathEquals($expected, $result);
 
-        $expected = $themePath . 'Plugin' . DS . 'TestPlugin' . DS . 'Layout' . DS . 'plugin_default.php';
+        $expected = $themePath . 'Plugin' . DS . 'TestPlugin' . DS . 'layout' . DS . 'plugin_default.php';
         $result = $ThemeView->getLayoutFileName('plugin_default');
         $this->assertPathEquals($expected, $result);
 
-        $expected = $themePath . 'Layout' . DS . 'default.php';
+        $expected = $themePath . 'layout' . DS . 'default.php';
         $result = $ThemeView->getLayoutFileName('default');
         $this->assertPathEquals($expected, $result);
     }
@@ -562,7 +562,7 @@ class ViewTest extends TestCase
         $result = $View->getViewFileName('index');
         $this->assertPathEquals($expected, $result);
 
-        $expected = $pluginPath . 'templates' . DS . 'Layout' . DS . 'default.php';
+        $expected = $pluginPath . 'templates' . DS . 'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
     }
@@ -693,17 +693,17 @@ class ViewTest extends TestCase
 
         $View = new TestView(null, null, null, $viewOptions);
 
-        $expected = TEST_APP . 'templates' . DS . 'Layout' . DS . 'default.php';
+        $expected = TEST_APP . 'templates' . DS . 'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $View->setLayoutPath('rss');
-        $expected = TEST_APP . 'templates' . DS . 'Layout' . DS . 'rss' . DS . 'default.php';
+        $expected = TEST_APP . 'templates' . DS . 'layout' . DS . 'rss' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $View->setLayoutPath('Email' . DS . 'html');
-        $expected = TEST_APP . 'templates' . DS . 'Layout' . DS . 'Email' . DS . 'html' . DS . 'default.php';
+        $expected = TEST_APP . 'templates' . DS . 'layout' . DS . 'Email' . DS . 'html' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
     }
@@ -724,13 +724,13 @@ class ViewTest extends TestCase
         $View = new TestView(null, null, null, $viewOptions);
 
         $expected = TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'templates' . DS .
-            'Layout' . DS . 'default.php';
+            'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName('TestPlugin.default');
         $this->assertPathEquals($expected, $result);
 
         $View->setRequest($View->getRequest()->withParam('plugin', 'TestPlugin'));
         $expected = TEST_APP . 'Plugin' . DS . 'TestPlugin' . DS . 'templates' . DS .
-            'Layout' . DS . 'default.php';
+            'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName('default');
         $this->assertPathEquals($expected, $result);
     }
@@ -747,7 +747,7 @@ class ViewTest extends TestCase
         // Prefix specific layout
         $View->setRequest($View->getRequest()->withParam('prefix', 'foo_prefix'));
         $expected = TEST_APP . 'templates' . DS .
-            'FooPrefix' . DS . 'Layout' . DS . 'default.php';
+            'FooPrefix' . DS . 'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
@@ -758,19 +758,19 @@ class ViewTest extends TestCase
         // Nested prefix layout
         $View->setRequest($View->getRequest()->withParam('prefix', 'foo_prefix/bar_prefix'));
         $expected = TEST_APP . 'templates' . DS .
-            'FooPrefix' . DS . 'BarPrefix' . DS . 'Layout' . DS . 'default.php';
+            'FooPrefix' . DS . 'BarPrefix' . DS . 'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
 
         $expected = TEST_APP . 'templates' . DS .
-            'FooPrefix' . DS . 'Layout' . DS . 'nested_prefix_cascade.php';
+            'FooPrefix' . DS . 'layout' . DS . 'nested_prefix_cascade.php';
         $result = $View->getLayoutFileName('nested_prefix_cascade');
         $this->assertPathEquals($expected, $result);
 
         // Fallback to app's layout
         $View->setRequest($View->getRequest()->withParam('prefix', 'Admin'));
         $expected = TEST_APP . 'templates' . DS .
-            'Layout' . DS . 'default.php';
+            'layout' . DS . 'default.php';
         $result = $View->getLayoutFileName();
         $this->assertPathEquals($expected, $result);
     }

tests/test_app/Plugin/Company/TestPluginThree/templates/Layout/default.php → tests/test_app/Plugin/Company/TestPluginThree/templates/layout/default.php


tests/test_app/Plugin/TestPlugin/templates/Layout/Email/text/plug_default.php → tests/test_app/Plugin/TestPlugin/templates/layout/Email/text/plug_default.php


tests/test_app/Plugin/TestPlugin/templates/Layout/default.php → tests/test_app/Plugin/TestPlugin/templates/layout/default.php


tests/test_app/Plugin/TestPluginTwo/templates/Layout/Email/text/default.php → tests/test_app/Plugin/TestPluginTwo/templates/layout/Email/text/default.php


tests/test_app/Plugin/TestTheme/templates/Plugin/TestPlugin/Layout/plugin_default.php → tests/test_app/Plugin/TestTheme/templates/Plugin/TestPlugin/layout/plugin_default.php


tests/test_app/Plugin/TestTheme/templates/Layout/default.php → tests/test_app/Plugin/TestTheme/templates/layout/default.php


tests/test_app/templates/FooPrefix/BarPrefix/Layout/default.php → tests/test_app/templates/FooPrefix/BarPrefix/layout/default.php


tests/test_app/templates/FooPrefix/Layout/default.php → tests/test_app/templates/FooPrefix/layout/default.php


tests/test_app/templates/FooPrefix/Layout/nested_prefix_cascade.php → tests/test_app/templates/FooPrefix/layout/nested_prefix_cascade.php


tests/test_app/templates/Layout/Email/html/default.php → tests/test_app/templates/layout/Email/html/default.php


tests/test_app/templates/Layout/Email/html/japanese.php → tests/test_app/templates/layout/Email/html/japanese.php


tests/test_app/templates/Layout/Email/html/thin.php → tests/test_app/templates/layout/Email/html/thin.php


tests/test_app/templates/Layout/Email/text/default.php → tests/test_app/templates/layout/Email/text/default.php


tests/test_app/templates/Layout/Email/text/japanese.php → tests/test_app/templates/layout/Email/text/japanese.php


tests/test_app/templates/Layout/ajax.php → tests/test_app/templates/layout/ajax.php


tests/test_app/templates/Layout/ajax2.php → tests/test_app/templates/layout/ajax2.php


tests/test_app/templates/Layout/banana.php → tests/test_app/templates/layout/banana.php


tests/test_app/templates/Layout/default.php → tests/test_app/templates/layout/default.php


tests/test_app/templates/Layout/error.php → tests/test_app/templates/layout/error.php


tests/test_app/templates/Layout/js/default.php → tests/test_app/templates/layout/js/default.php


tests/test_app/templates/Layout/json/default.php → tests/test_app/templates/layout/json/default.php


tests/test_app/templates/Layout/rss/default.php → tests/test_app/templates/layout/rss/default.php


tests/test_app/templates/Layout/with_flash.php → tests/test_app/templates/layout/with_flash.php


tests/test_app/templates/Layout/xml/default.php → tests/test_app/templates/layout/xml/default.php