public function get($tag) { if (!isset($this->styles[$tag])) { throw new OutOfBoundsException(sprintf('The style tag "%s" does not exist.', $tag)); } return $this->styles[$tag]; }
/** * @expectedException \OutOfBoundsException * @expectedExceptionMessage foobar */ public function testGetFailsIfNotFound() { $styleSet = new StyleSet(); $styleSet->get('foobar'); }