Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix failing test in Debugger test case.

  • Loading branch information...
commit e9779e71266c68919e3a7221bc0147484f47ee18 1 parent 3b57704
@markstory markstory authored
View
6 lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -302,6 +302,7 @@ public function testExportVar() {
$expected = <<<TEXT
object(View) {
Helpers => object(HelperCollection) {}
+ Blocks => object(ViewBlock) {}
plugin => null
name => ''
passedArgs => array()
@@ -322,15 +323,14 @@ public function testExportVar() {
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);
}
View
16 lib/Cake/View/View.php
@@ -393,12 +393,12 @@ public function render($view = null, $layout = null) {
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 @@ public function render($view = null, $layout = null) {
$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 @@ public function renderLayout($content, $layout = null) {
}
$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 @@ public function __get($name) {
return $this->request;
case 'output':
return $this->Blocks->get('content');
+ default:
+ return $this->{$name};
}
return null;
}
@@ -732,6 +734,8 @@ public function __set($name, $value) {
switch ($name) {
case 'output':
return $this->Blocks->set('content', $value);
+ default:
+ $this->{$name} = $value;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.