mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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
This commit is contained in:
parent
4ff21a6a08
commit
fb0a327a38
3 changed files with 11 additions and 17 deletions
|
@ -744,7 +744,7 @@ class View extends Object {
|
|||
${$camelBackedHelper}->{$subHelper} =& $loadedHelpers[$subHelper];
|
||||
}
|
||||
}
|
||||
$this->loaded[$camelBackedHelper] = (${$camelBackedHelper});
|
||||
$this->loaded[$camelBackedHelper] =& ${$camelBackedHelper};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -742,7 +742,6 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->assertEqual($result, '<input type="hidden" name="data[Contact][published]" value="0" id="theID_" /><input type="checkbox" name="data[Contact][published]" type="checkbox" id="theID" value="1" />');
|
||||
}
|
||||
|
||||
|
||||
function tearDown() {
|
||||
unset($this->Form);
|
||||
}
|
||||
|
|
|
@ -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 = '/^<a href="#"\s+>Next ><\/a>$/';
|
||||
|
||||
|
||||
$this->assertPattern($expected, $result);
|
||||
|
||||
|
||||
$result = $this->Html->link('Next >', '#', array('escape' => false));
|
||||
$expected = '/^<a href="#"\s+>Next ><\/a>$/';
|
||||
|
||||
|
||||
$this->assertPattern($expected, $result);
|
||||
}
|
||||
|
||||
|
||||
function testImageLink() {
|
||||
$result = $this->Html->link($this->Html->image('test.gif'), '#', array(), false, false, false);
|
||||
$expected = '/^<a href="#"\s+><img\s+src="img\/test.gif"\s+alt=""\s+\/><\/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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue