From e9779e71266c68919e3a7221bc0147484f47ee18 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 17 Dec 2011 22:53:21 -0500 Subject: [PATCH] Fix failing test in Debugger test case. --- lib/Cake/Test/Case/Utility/DebuggerTest.php | 6 +++--- lib/Cake/View/View.php | 16 ++++++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 03898546c..4443af7de 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -302,6 +302,7 @@ class DebuggerTest extends CakeTestCase { $expected = << object(HelperCollection) {} + Blocks => object(ViewBlock) {} plugin => null name => '' passedArgs => array() @@ -322,15 +323,14 @@ object(View) { validationErrors => array() hasRendered => false uuids => array() - output => false request => null elementCache => 'default' int => (int) 2 float => (float) 1.333 } TEXT; - $result = str_replace(array("\r\n", "\n"), "", $result); - $expected = str_replace(array("\r\n", "\n"), "", $expected); + // $result = str_replace(array("\r\n", "\n"), "", $result); + // $expected = str_replace(array("\r\n", "\n"), "", $expected); $this->assertEquals($expected, $result); } diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 89fcef653..4bebcfbc6 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -393,12 +393,12 @@ class View extends Object { if (!$this->_helpersLoaded) { $this->loadHelpers(); } - $this->output = ''; + $this->Blocks->set('content', ''); if ($view !== false && $viewFileName = $this->_getViewFileName($view)) { $this->_currentType = self::TYPE_VIEW; $this->Helpers->trigger('beforeRender', array($viewFileName)); - $this->output = $this->_render($viewFileName); + $this->Blocks->set('content', $this->_render($viewFileName)); $this->Helpers->trigger('afterRender', array($viewFileName)); } @@ -406,10 +406,10 @@ class View extends Object { $layout = $this->layout; } if ($layout && $this->autoLayout) { - $this->output = $this->renderLayout('', $layout); + $this->Blocks->set('content', $this->renderLayout('', $layout)); } $this->hasRendered = true; - return $this->output; + return $this->Blocks->get('content'); } /** @@ -462,10 +462,10 @@ class View extends Object { } $this->_currentType = self::TYPE_LAYOUT; - $this->output = $this->_render($layoutFileName); + $this->Blocks->set('content', $this->_render($layoutFileName)); $this->Helpers->trigger('afterLayout', array($layoutFileName)); - return $this->output; + return $this->Blocks->get('content'); } /** @@ -717,6 +717,8 @@ class View extends Object { return $this->request; case 'output': return $this->Blocks->get('content'); + default: + return $this->{$name}; } return null; } @@ -732,6 +734,8 @@ class View extends Object { switch ($name) { case 'output': return $this->Blocks->set('content', $value); + default: + $this->{$name} = $value; } }