/** * adds image to element container. * * @param string $fileName name of image file. * @param PHPRtfLite_ParFormat $parFormat paragraph format, ff null image will appear in the same paragraph. * @param float $width if null image is displayed by it's height. * @param float $height if null image is displayed by it's width. * If boths parameters are null, image is displayed as it is. * * @return PHPRtfLite_Image */ public function addImage($fileName, PHPRtfLite_ParFormat $parFormat = null, $width = null, $height = null) { $image = PHPRtfLite_Image::createFromFile($this->_rtf, $fileName, $width, $height); if ($parFormat) { $image->setParFormat($parFormat); } $this->_elements[] = $image; return $image; }
/** * */ public function testRenderMissingImageFile() { $image = PHPRtfLite_Image::createFromFile($this->_rtf, ''); $this->assertTrue($image->isMissing()); }