diff --git a/lib/Cake/Test/TestCase/View/ViewTest.php b/lib/Cake/Test/TestCase/View/ViewTest.php index a33016c0b5b..d5092d3bff0 100644 --- a/lib/Cake/Test/TestCase/View/ViewTest.php +++ b/lib/Cake/Test/TestCase/View/ViewTest.php @@ -224,7 +224,7 @@ public function beforeLayout($viewFile) { * @return void */ public function afterLayout($layoutFile) { - $this->_View->output .= 'modified in the afterlife'; + $this->_View->append('content', 'modified in the afterlife'); } } @@ -1465,19 +1465,6 @@ public function testPropertySetting() { $this->assertEquals('test', $this->View->pageTitle); } -/** - * Test that setting arbitrary properties still works. - * - * @return void - */ - public function testPropertySettingMagicGet() { - $this->assertFalse(isset($this->View->action)); - $this->View->request->params['action'] = 'login'; - $this->assertEquals('login', $this->View->action); - $this->assertTrue(isset($this->View->action)); - $this->assertTrue(!empty($this->View->action)); - } - /** * test memory leaks that existed in _paths at one point. * diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 0bc5d887fe2..ff0a75f3075 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -781,25 +781,12 @@ public function set($one, $two = null) { } /** - * Magic accessor for helpers. Provides access to attributes that were deprecated. + * Magic accessor for helpers. * * @param string $name Name of the attribute to get. * @return mixed */ public function __get($name) { - switch ($name) { - case 'base': - case 'here': - case 'webroot': - case 'data': - return $this->request->{$name}; - case 'action': - return $this->request->params['action']; - case 'params': - return $this->request; - case 'output': - return $this->Blocks->get('content'); - } if (isset($this->Helpers->{$name})) { $this->{$name} = $this->Helpers->{$name}; return $this->Helpers->{$name}; @@ -815,12 +802,7 @@ public function __get($name) { * @return mixed */ public function __set($name, $value) { - switch ($name) { - case 'output': - return $this->Blocks->set('content', $value); - default: - $this->{$name} = $value; - } + $this->{$name} = $value; } /** @@ -833,10 +815,6 @@ public function __isset($name) { if (isset($this->{$name})) { return true; } - $magicGet = array('base', 'here', 'webroot', 'data', 'action', 'params', 'output'); - if (in_array($name, $magicGet)) { - return $this->__get($name) !== null; - } return false; } @@ -891,7 +869,6 @@ protected function _render($viewFile, $data = array()) { if ($initialBlocks !== $remainingBlocks) { throw new Error\Exception(__d('cake_dev', 'The "%s" block was left open. Blocks are not allowed to cross files.', $this->Blocks->active())); } - return $content; }