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