/** * Renders the object * * @return string * @throws IconException */ public function render() { if (is_null($this->icon)) { throw IconException::noIconSpecified(); } $baseClass = $this->config->getIconPrefix(); $icon = $this->icon; $attributes = new Attributes($this->attributes, ['class' => "{$baseClass} {$baseClass}-{$icon}"]); return "<span {$attributes}></span>"; }
function it_blows_up_if_you_dont_use_the_create() { $this->withAttributes(['foo' => 'bar'])->shouldThrow(IconException::noIconSpecified())->duringRender(); }