public function getParagraph($index = 0) { if ($index >= count($this->richTextParagraphs)) { throw new \Exception("Invalid paragraph count."); } return $this->richTextParagraphs[$index]; }
/** * @expectedException \Exception * expectedExceptionMessage Invalid paragraph count. */ public function testGetParagraphException() { $object = new RichText(); $object->getParagraph(1000); }