mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
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:
parent
abb287180d
commit
5692e7f344
1 changed files with 18 additions and 3 deletions
|
@ -232,12 +232,20 @@
|
||||||
class FormHelperTest extends CakeTestCase {
|
class FormHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
function startTest($method) {
|
function startTest($method) {
|
||||||
$this->Form = new FormHelper();
|
$this->Form =& new FormHelper();
|
||||||
$this->Form->Html = new HtmlHelper();
|
$this->Form->Html =& new HtmlHelper();
|
||||||
$view = new View(new TheTestController());
|
$this->Controller =& new TheTestController();
|
||||||
|
$this->View =& new View($this->Controller);
|
||||||
ClassRegistry::addObject('view', $view);
|
ClassRegistry::addObject('view', $view);
|
||||||
ClassRegistry::addObject('Contact', new Contact());
|
ClassRegistry::addObject('Contact', new Contact());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function endTest($method) {
|
||||||
|
unset($this->Form->Html);
|
||||||
|
unset($this->Form);
|
||||||
|
unset($this->Controller);
|
||||||
|
unset($this->View);
|
||||||
|
}
|
||||||
|
|
||||||
function testFormValidationAssociated() {
|
function testFormValidationAssociated() {
|
||||||
$this->UserForm =& new UserForm();
|
$this->UserForm =& new UserForm();
|
||||||
|
@ -389,6 +397,13 @@ class FormHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Form->input('Model/field', array('type' => 'file', 'class' => 'textbox'));
|
$result = $this->Form->input('Model/field', array('type' => 'file', 'class' => 'textbox'));
|
||||||
$this->assertPattern('/class="textbox"/', $result);
|
$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 & World > weird chars" id="ModelField" /></div>';
|
||||||
|
$this->assertEqual($result, $expected);
|
||||||
|
|
||||||
|
unset($this->Form->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testLabel() {
|
function testLabel() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue