/** * Adds a style. * * @param Style $style The style to add. * * @throws LogicException If the tag of the style is not set. */ public function add(Style $style) { if (!$style->getTag()) { throw new LogicException('The tag of a style added to the style set must be set.'); } $this->styles[$style->getTag()] = $style; }
public function testDefaults() { $style = new Style(); $this->assertNull($style->getTag()); $this->assertNull($style->getForegroundColor()); $this->assertNull($style->getBackgroundColor()); $this->assertFalse($style->isBold()); $this->assertFalse($style->isUnderlined()); $this->assertFalse($style->isBlinking()); $this->assertFalse($style->isHidden()); $this->assertFalse($style->isInverse()); }