diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index 557c686374a..9c338aead5f 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -27,7 +27,7 @@ * @package cake * @subpackage cake.cake.libs.view */ -class Helper { +class Helper extends Object { /** * List of helpers used by this helper diff --git a/cake/libs/view/helpers/js.php b/cake/libs/view/helpers/js.php index 2c302cb8853..ca907436841 100644 --- a/cake/libs/view/helpers/js.php +++ b/cake/libs/view/helpers/js.php @@ -119,7 +119,7 @@ public function __construct($settings = array()) { * @param array $params Parameters for the method being called. * @return mixed Depends on the return of the dispatched method, or it could be an instance of the EngineHelper */ - public function call__($method, $params) { + public function __call($method, $params) { if (isset($this->{$this->__engineName}) && method_exists($this->{$this->__engineName}, $method)) { $buffer = false; if (in_array(strtolower($method), $this->{$this->__engineName}->bufferedMethods)) { diff --git a/cake/tests/cases/libs/view/helpers/js.test.php b/cake/tests/cases/libs/view/helpers/js.test.php index d7d5c6c3820..12512f56b3f 100644 --- a/cake/tests/cases/libs/view/helpers/js.test.php +++ b/cake/tests/cases/libs/view/helpers/js.test.php @@ -83,13 +83,13 @@ function startTest() { $this->_asset = Configure::read('Asset.timestamp'); Configure::write('Asset.timestamp', false); - $this->Js =& new JsHelper('JsBase'); - $this->Js->Html =& new HtmlHelper(); - $this->Js->Form =& new FormHelper(); - $this->Js->Form->Html =& new HtmlHelper(); - $this->Js->JsBaseEngine =& new JsBaseEngineHelper(); + $this->Js = new JsHelper('JsBase'); + $this->Js->Html = new HtmlHelper(); + $this->Js->Form = new FormHelper(); + $this->Js->Form->Html = new HtmlHelper(); + $this->Js->JsBaseEngine = new JsBaseEngineHelper(); - $view =& new JsHelperMockView(); + $view = new JsHelperMockView(); ClassRegistry::addObject('view', $view); } @@ -111,11 +111,11 @@ function endTest() { * @return void */ function _useMock() { - $this->Js =& new JsHelper(array('TestJs')); - $this->Js->TestJsEngine =& new TestJsEngineHelper($this); - $this->Js->Html =& new HtmlHelper(); - $this->Js->Form =& new FormHelper(); - $this->Js->Form->Html =& new HtmlHelper(); + $this->Js = new JsHelper(array('TestJs')); + $this->Js->TestJsEngine = new TestJsEngineHelper($this); + $this->Js->Html = new HtmlHelper(); + $this->Js->Form = new FormHelper(); + $this->Js->Form->Html = new HtmlHelper(); } /** @@ -124,16 +124,16 @@ function _useMock() { * @return void */ function testConstruction() { - $js =& new JsHelper(); + $js = new JsHelper(); $this->assertEqual($js->helpers, array('Html', 'Form', 'JqueryEngine')); - $js =& new JsHelper(array('mootools')); + $js = new JsHelper(array('mootools')); $this->assertEqual($js->helpers, array('Html', 'Form', 'mootoolsEngine')); - $js =& new JsHelper('prototype'); + $js = new JsHelper('prototype'); $this->assertEqual($js->helpers, array('Html', 'Form', 'prototypeEngine')); - $js =& new JsHelper('MyPlugin.Dojo'); + $js = new JsHelper('MyPlugin.Dojo'); $this->assertEqual($js->helpers, array('Html', 'Form', 'MyPlugin.DojoEngine')); } @@ -148,7 +148,7 @@ function testMethodDispatching() { $this->Js->methodOne(); - $this->Js->TestEngine =& new StdClass(); + $this->Js->TestEngine = new StdClass(); $this->expectError(); $this->Js->someMethodThatSurelyDoesntExist(); } @@ -228,7 +228,7 @@ function testWriteScriptsNoFile() { $result = $this->Js->writeBuffer(array('onDomReady' => true, 'cache' => false, 'clear' => false)); ClassRegistry::removeObject('view'); - $view =& new JsHelperMockView(); + $view = new JsHelperMockView(); ClassRegistry::addObject('view', $view); $view->expectCallCount('addScript', 1); @@ -244,7 +244,7 @@ function testWriteScriptsNoFile() { function testWriteBufferNotInline() { $this->Js->set('foo', 1); - $view =& new JsHelperMockView(); + $view = new JsHelperMockView(); ClassRegistry::removeObject('view'); ClassRegistry::addObject('view', $view); $view->expectCallCount('addScript', 1);