/** * @covers ::set * @covers ::setValue * @group Fieldset */ public function testSetValue() { $radio1 = new Radio('one', [], 'test'); $radio2 = new Radio('two', [], 'second'); $this->object[] = $radio1; $this->object[] = $radio2; $this->object->setValue('test'); $this->assertEquals(true, $radio1->isChecked()); $this->assertEquals(false, $radio2->isChecked()); $this->object->setValue('second'); $this->assertEquals(false, $radio1->isChecked()); $this->assertEquals(true, $radio2->isChecked()); }
/** * @covers ::__construct * @group Fieldset */ public function testConstruct() { $attributes = ['type' => 'radio', 'name' => '', 'value' => null]; $instance = new Radio(); $this->assertEquals($attributes, $instance->getAttributes()); }