Skip to content
This repository
Browse code

Update test case for disabled radio buttons (allow boolean value)

  • Loading branch information...
commit d6b9b48d4a705c1df848daf833cc9effd48410e3 1 parent 7dfe727
Christian Hieke authored November 17, 2011
22  lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -3344,6 +3344,28 @@ public function testRadioDisabled() {
3344 3344
 			'/fieldset'
3345 3345
 		);
3346 3346
 		$this->assertTags($result, $expected);
  3347
+
  3348
+		$result = $this->Form->radio(
  3349
+			'Model.field',
  3350
+			array('option A', 'option B'),
  3351
+			array('disabled' => true, 'value' => 'option A')
  3352
+		);
  3353
+		$expected = array(
  3354
+			'fieldset' => array(),
  3355
+			'legend' => array(),
  3356
+			'Field',
  3357
+			'/legend',
  3358
+			array('input' => array('type' => 'radio', 'name' => 'data[Model][field]', 'value' => '0', 'id' => 'ModelField0', 'disabled' => 'disabled', 'checked' => 'checked')),
  3359
+			array('label' => array('for' => 'ModelField0')),
  3360
+			'option A',
  3361
+			'/label',
  3362
+			array('input' => array('type' => 'radio', 'name' => 'data[Model][field]', 'value' => '1', 'id' => 'ModelField1', 'disabled' => 'disabled')),
  3363
+			array('label' => array('for' => 'ModelField1')),
  3364
+			'option B',
  3365
+			'/label',
  3366
+			'/fieldset'
  3367
+		);
  3368
+		$this->assertTags($result, $expected);
3347 3369
 	}
3348 3370
 
3349 3371
 /**

0 notes on commit d6b9b48

Please sign in to comment.
Something went wrong with that request. Please try again.