Esempio n. 1
0
 /**
  * @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());
 }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
 /**
  * @covers ::render
  * @group  Fieldset
  */
 public function testRender()
 {
     $renderer = \Mockery::mock('Fuel\\Fieldset\\Render');
     $this->assertXmlStringEqualsXmlString('<option value=""></option>', $this->object->render($renderer));
 }