From 5692e7f344f6cc4a09872fc99399482425b3778c Mon Sep 17 00:00:00 2001 From: "mariano.iglesias" Date: Sat, 28 Apr 2007 07:48:31 +0000 Subject: [PATCH] Adding test for #2494 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4892 3807eeeb-6ff5-0310-8944-8be069107fe0 --- .../cases/libs/view/helpers/form.test.php | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 583f8d9a7..b5d818fdf 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -232,12 +232,20 @@ class FormHelperTest extends CakeTestCase { function startTest($method) { - $this->Form = new FormHelper(); - $this->Form->Html = new HtmlHelper(); - $view = new View(new TheTestController()); + $this->Form =& new FormHelper(); + $this->Form->Html =& new HtmlHelper(); + $this->Controller =& new TheTestController(); + $this->View =& new View($this->Controller); ClassRegistry::addObject('view', $view); ClassRegistry::addObject('Contact', new Contact()); } + + function endTest($method) { + unset($this->Form->Html); + unset($this->Form); + unset($this->Controller); + unset($this->View); + } function testFormValidationAssociated() { $this->UserForm =& new UserForm(); @@ -389,6 +397,13 @@ class FormHelperTest extends CakeTestCase { $result = $this->Form->input('Model/field', array('type' => 'file', 'class' => 'textbox')); $this->assertPattern('/class="textbox"/', $result); + + $this->Form->data = array('Model' => array( 'field' => 'Hello & World > weird chars' )); + $result = $this->Form->input('Model/field'); + $expected = '
'; + $this->assertEqual($result, $expected); + + unset($this->Form->data); } function testLabel() {