Skip to content

Commit

Permalink
Fixing left over action from previos refactoring of viewClass/view.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 8, 2011
1 parent 0d3288b commit de57802
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/view/view.php
Expand Up @@ -680,7 +680,7 @@ protected function _getViewFileName($name = null) {
}

if ($name === null) {
$name = $this->action;
$name = $this->view;

This comment has been minimized.

Copy link
@lorenzo

lorenzo Mar 9, 2011

Member

This breaks the ControllerTestCase tests

This comment has been minimized.

Copy link
@markstory

markstory Mar 9, 2011

Author Member

Guess they need to be updated. ADMad changed view -> viewClass, and this get left behind. I'll take a look at the ControllerTestCase

This comment has been minimized.

Copy link
@ADmad

ADmad Mar 9, 2011

Member

Sorry about that. I am pretty sure i updated and ensured all tests for controller and view were passing. Guess i was mistaken.

}
$name = str_replace('/', DS, $name);

Expand Down
14 changes: 14 additions & 0 deletions cake/tests/cases/libs/view/view.test.php
Expand Up @@ -701,6 +701,20 @@ function testRender() {
$this->assertPattern("/<div id=\"content\">posts index<\/div>/", $result);
}

/**
* test that View::$view works
*
* @return void
*/
function testRenderUsingViewProperty() {
$this->PostsController->view = 'cache_form';
$View = new TestView($this->PostsController);

$this->assertEquals('cache_form', $View->view);
$result = $View->render();
$this->assertRegExp('/Add User/', $result);
}

/**
* test that view vars can replace the local helper variables
* and not overwrite the $this->Helper references
Expand Down

0 comments on commit de57802

Please sign in to comment.