/** * @covers ::setValue * @covers ::getValue * @covers ::getAttributes * @covers ::set * @group Fieldset */ public function testSetValue() { $option = new Option('test'); $this->object[] = $option; $this->object->setValue('test'); $this->assertEquals(['selected', 'value' => 'test'], $option->getAttributes()); $this->assertEquals('test', $this->object->getValue()); }
/** * Sets the given Option as selected * * @param Option $option * * @since 2.0 */ protected function assignSelected(Option $option) { $attributes = $option->getAttributes(); $attributes[] = 'selected'; $option->setAttributes($attributes); }
/** * @covers ::render * @group Fieldset */ public function testRender() { $renderer = \Mockery::mock('Fuel\\Fieldset\\Render'); $this->assertXmlStringEqualsXmlString('<option value=""></option>', $this->object->render($renderer)); }