Skip to content

Commit

Permalink
Add failing test for cakephp#2661
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 14, 2012
1 parent 2fd15b6 commit 0f21007
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/Cake/Test/Case/View/ViewTest.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -993,6 +993,24 @@ public function testRenderUsingViewProperty() {
$this->assertRegExp('/Add User/', $result); $this->assertRegExp('/Add User/', $result);
} }


/**
* Test render()ing a file in a subdir from a custom viewPath
* in a plugin.
*
* @return void
*/
public function testGetViewFileNameSubdirWithPluginAndViewPath()
{
$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 * test that view vars can replace the local helper variables
* and not overwrite the $this->Helper references * and not overwrite the $this->Helper references
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
Content from TestPlugin.Elements/sub_dir/sub_element

0 comments on commit 0f21007

Please sign in to comment.