Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add failing test for #2661

  • Loading branch information...
commit 0f2100767b1352e2c6712584eb7ea37d144558d8 1 parent 2fd15b6
@markstory markstory authored
View
18 lib/Cake/Test/Case/View/ViewTest.php
@@ -994,6 +994,24 @@ public function testRenderUsingViewProperty() {
}
/**
+ * Test render()ing a file in a subdir from a custom viewPath
+ * in a plugin.
+ *
+ * @return void
+ */
+ public function testGetViewFileNameSubdirWithPluginAndViewPath()
+ {
@ADmad Collaborator
ADmad added a note

The code sniffer didn't barf on brace on new line? :(

@markstory Owner

Hrmm, I'll fix this and check the sniffer too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ $this->PostsController->plugin = 'TestPlugin';
+ $this->PostsController->viewPath = 'Elements';
+ $this->PostsController->name = 'Posts';
+ $View = new TestView($this->PostsController);
+
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' .
+ DS . 'View' . DS . 'Elements' . DS . 'sub_dir' . DS . 'sub_element.ctp';
+ $this->assertEquals($expected, $View->getViewFileName('sub_dir/sub_element'));
+ }
+
+/**
* test that view vars can replace the local helper variables
* and not overwrite the $this->Helper references
*
View
1  lib/Cake/Test/test_app/Plugin/TestPlugin/View/Elements/sub_dir/sub_element.ctp
@@ -0,0 +1 @@
+Content from TestPlugin.Elements/sub_dir/sub_element
Please sign in to comment.
Something went wrong with that request. Please try again.