|
|
@@ -422,7 +422,7 @@ class ViewTest extends TestCase {
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
- public function testPluginPathGeneration() {
|
|
|
+ public function testPathPluginGeneration() {
|
|
|
$viewOptions = ['plugin' => 'TestPlugin',
|
|
|
'name' => 'TestPlugin',
|
|
|
'viewPath' => 'Tests',
|
|
|
@@ -446,6 +446,34 @@ class ViewTest extends TestCase {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Test that themed plugin paths are generated correctly.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testPathThemedPluginGeneration() {
|
|
|
+ $viewOptions = ['plugin' => 'TestPlugin',
|
|
|
+ 'name' => 'TestPlugin',
|
|
|
+ 'viewPath' => 'Tests',
|
|
|
+ 'view' => 'index',
|
|
|
+ 'theme' => 'TestTheme'
|
|
|
+ ];
|
|
|
+
|
|
|
+ $View = new TestView(null, null, null, $viewOptions);
|
|
|
+ $paths = $View->paths('TestPlugin');
|
|
|
+ $pluginPath = Plugin::path('TestPlugin');
|
|
|
+ $themePath = Plugin::path('TestTheme');
|
|
|
+ $expected = array(
|
|
|
+ $themePath . 'src' . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
|
|
|
+ $themePath . 'src' . DS . 'Template' . DS,
|
|
|
+ TEST_APP . 'TestApp' . DS . 'Template' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
|
|
|
+ $pluginPath . 'src' . DS . 'Template' . DS,
|
|
|
+ TEST_APP . 'TestApp' . DS . 'Template' . DS,
|
|
|
+ CAKE . 'Template' . DS,
|
|
|
+ );
|
|
|
+ $this->assertPathEquals($expected, $paths);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
* Test that CamelCase'd plugins still find their view files.
|
|
|
*
|
|
|
* @return void
|