Permalink
Browse files

added test to disprove #3588

  • Loading branch information...
1 parent ee08fe5 commit fa1d22dc5eeebd532f0f34bdb579dee0a61c6177 @ceeram ceeram committed Jan 31, 2013
Showing with 23 additions and 0 deletions.
  1. +23 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -7417,6 +7417,29 @@ public function testFormInputRequiredDetection() {
'/div'
);
$this->assertTags($result, $expected);
+
+ $result = $this->Form->input('Contact.boolean_field', array('type' => 'checkbox', 'required' => true));
+ $expected = array(
+ 'div' => array('class' => 'input checkbox required'),
+ array('input' => array(
+ 'type' => 'hidden',
+ 'name' => 'data[Contact][boolean_field]',
+ 'id' => 'ContactBooleanField_',
+ 'value' => '0'
+ )),
+ array('input' => array(
+ 'type' => 'checkbox',
+ 'name' => 'data[Contact][boolean_field]',
+ 'value' => '1',
+ 'id' => 'ContactBooleanField',
+ 'required' => 'required'
+ )),
+ 'label' => array('for' => 'ContactBooleanField'),
+ 'Boolean Field',
+ '/label',
+ '/div'
+ );
+ $this->assertTags($result, $expected);
}
/**

0 comments on commit fa1d22d

Please sign in to comment.