Adding test for #2494

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4892 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mariano.iglesias 2007-04-28 07:48:31 +00:00
parent abb287180d
commit 5692e7f344

View file

@ -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 = '<div class="input"><label for="ModelField">Field</label><input name="data[Model][field]" type="text" value="Hello &amp; World &gt; weird chars" id="ModelField" /></div>';
$this->assertEqual($result, $expected);
unset($this->Form->data);
}
function testLabel() {