/** * Testing the setSize method to see if validation fails. * * @since 1.0 */ public function testSetSizeInvalid() { $this->txt = new Text(); $this->txt->setSize(4); try { $this->txt->setValue('Too many characters!'); $this->fail('testing the setSize method to see if validation fails'); } catch (IllegalArguementException $e) { $this->assertEquals('Not a valid text value!', $e->getMessage(), 'testing the setSize method to see if validation fails'); } }
/** * Loads the content of the ArticleObject from the specified file path. * * @param $filePath * * @since 1.0 * * @throws Alpha\Exception\FileNotFoundException */ public function loadContentFromFile($filePath) { try { $this->content->setValue(file_get_contents($filePath)); $this->filePath = $filePath; } catch (\Exception $e) { throw new FileNotFoundException($e->getMessage()); } }