public function testOptionCreatedFromArray() { $option = Option::fromArray(['value' => 'foo', 'title' => 'bar', 'frequency' => 2, 'active' => false]); $this->assertEquals('foo', $option->getValue()); $this->assertEquals('bar', $option->getTitle()); $this->assertEquals(2, $option->getFrequency()); $this->assertEquals(false, $option->isActive()); }
/** * @return string */ public function renderItems() { $html = PHP_EOL; foreach ($this->getArrayableItems() as $item) { if (is_array($item)) { $item = Option::fromArray($item); } $html .= $this->renderItem($item) . PHP_EOL; } return $html; }