mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding test to formHelper. Testing checkbox in response to #4869
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7146 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
2d8e63ae7b
commit
8c32547351
1 changed files with 7 additions and 0 deletions
|
@ -2332,6 +2332,13 @@ class FormHelperTest extends CakeTestCase {
|
|||
array('input' => array('type' => 'checkbox', 'name' => 'data[Model][field]', 'value' => '1', 'id' => 'ModelField'))
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Form->checkbox('Model.field', array('checked' => 'checked'));
|
||||
$expected = array(
|
||||
'input' => array('type' => 'hidden', 'name' => 'data[Model][field]', 'value' => '0', 'id' => 'ModelField_'),
|
||||
array('input' => array('type' => 'checkbox', 'name' => 'data[Model][field]', 'value' => '1', 'id' => 'ModelField', 'checked' => 'checked'))
|
||||
);
|
||||
$this->assertTags($result, $expected);
|
||||
|
||||
$this->Form->validationErrors['Model']['field'] = 1;
|
||||
$this->Form->data['Contact']['published'] = 1;
|
||||
|
|
Loading…
Reference in a new issue