isDisabled() public method

Check if the current selected option is disabled.
public isDisabled ( ) : boolean
return boolean
コード例 #1
0
 public function testRadioButtonIsDisabled()
 {
     $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'foo', 'disabled' => 'disabled'));
     $field = new ChoiceFormField($node);
     $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'bar'));
     $field->addChoice($node);
     $node = $this->createNode('input', '', array('type' => 'radio', 'name' => 'name', 'value' => 'baz', 'disabled' => ''));
     $field->addChoice($node);
     $field->select('foo');
     $this->assertEquals('foo', $field->getValue(), '->getValue() returns the value attribute of the selected radio button');
     $this->assertTrue($field->isDisabled());
     $field->select('bar');
     $this->assertEquals('bar', $field->getValue(), '->getValue() returns the value attribute of the selected radio button');
     $this->assertFalse($field->isDisabled());
     $field->select('baz');
     $this->assertEquals('baz', $field->getValue(), '->getValue() returns the value attribute of the selected radio button');
     $this->assertTrue($field->isDisabled());
 }