From de57802f05fc50577724e77f32fad887058c2129 Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 7 Mar 2011 21:50:53 -0500 Subject: [PATCH] Fixing left over action from previos refactoring of viewClass/view. --- cake/libs/view/view.php | 2 +- cake/tests/cases/libs/view/view.test.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 7939aa910..89d5ae5d5 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -680,7 +680,7 @@ class View extends Object { } if ($name === null) { - $name = $this->action; + $name = $this->view; } $name = str_replace('/', DS, $name); diff --git a/cake/tests/cases/libs/view/view.test.php b/cake/tests/cases/libs/view/view.test.php index 2b6417e5a..74058c3db 100644 --- a/cake/tests/cases/libs/view/view.test.php +++ b/cake/tests/cases/libs/view/view.test.php @@ -701,6 +701,20 @@ class ViewTest extends CakeTestCase { $this->assertPattern("/
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