From fb0a327a388c6cb7db335947724d2af5e21cf8f0 Mon Sep 17 00:00:00 2001 From: phpnut Date: Fri, 6 Jul 2007 04:31:45 +0000 Subject: [PATCH] Adding fix for #2823, fixes Element gets different instances of helper than view in PHP4 and PHP5 Removed HtmlHelperTest::testRadio(), the HtmlHelper::radio() has been deprecated git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5379 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/view/view.php | 2 +- .../cases/libs/view/helpers/form.test.php | 1 - .../cases/libs/view/helpers/html.test.php | 25 ++++++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/cake/libs/view/view.php b/cake/libs/view/view.php index 905229e2f..23911fb1c 100644 --- a/cake/libs/view/view.php +++ b/cake/libs/view/view.php @@ -744,7 +744,7 @@ class View extends Object { ${$camelBackedHelper}->{$subHelper} =& $loadedHelpers[$subHelper]; } } - $this->loaded[$camelBackedHelper] = (${$camelBackedHelper}); + $this->loaded[$camelBackedHelper] =& ${$camelBackedHelper}; } } diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 31d391781..a520d4917 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -742,7 +742,6 @@ class FormHelperTest extends CakeTestCase { $this->assertEqual($result, ''); } - function tearDown() { unset($this->Form); } diff --git a/cake/tests/cases/libs/view/helpers/html.test.php b/cake/tests/cases/libs/view/helpers/html.test.php index 17bec8230..01b1428c6 100644 --- a/cake/tests/cases/libs/view/helpers/html.test.php +++ b/cake/tests/cases/libs/view/helpers/html.test.php @@ -40,46 +40,41 @@ class TheHtmlTestController extends Controller { class HtmlHelperTest extends UnitTestCase { var $html = null; - + function setUp() { $this->Html =& new HtmlHelper(); $view =& new View(new TheHtmlTestController()); ClassRegistry::addObject('view', $view); } - + function testLinkEscape() { $result = $this->Html->link('Next >', '#'); $expected = '/^Next ><\/a>$/'; - + $this->assertPattern($expected, $result); - + $result = $this->Html->link('Next >', '#', array('escape' => false)); $expected = '/^Next ><\/a>$/'; - + $this->assertPattern($expected, $result); } - + function testImageLink() { $result = $this->Html->link($this->Html->image('test.gif'), '#', array(), false, false, false); $expected = '/^<\/a>$/'; - + $this->assertPattern($expected, $result); } - - function testRadio() { - $result = $this->Html->radio('Tests/process', array('0'=> 'zero', '1'=>'one')); - $this->assertNoPattern('/checked="checked"/', $result); - } - + function testStyle() { $result = $this->Html->style(array('display'=> 'none', 'margin'=>'10px')); $expected = 'style="display:none; margin:10px;"'; $this->assertEqual($expected, $result); - + $result = $this->Html->style(array('display'=> 'none', 'margin'=>'10px'), false); $expected = "display:none;\nmargin:10px;"; $this->assertEqual($expected, $result); - + } function tearDown() {