/** * Renders an option tag * * @param string $value * @param null | string $label * @param bool $selected * @return string */ private function renderOptionTag($value, $label = null, $selected = false) { $option = new TagBuilder("option"); $option->addAttribute('value', $value); $option->setContent(!is_null($label) ? $label : $value); if ($selected) { $option->addAttribute('selected', 'selected'); } return $option->render(); }
/** * @test */ public function tagContentCanBeOverridden() { $tagBuilder = new TagBuilder('foo', 'some content'); $tagBuilder->setContent(''); $this->assertEquals('<foo />', $tagBuilder->render()); }