mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +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
|
@ -2333,6 +2333,13 @@ class FormHelperTest extends CakeTestCase {
|
|||
);
|
||||
$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;
|
||||
$result = $this->Form->checkbox('Contact.published', array('id'=>'theID'));
|
||||
|
|
Loading…
Reference in a new issue