Exemplo n.º 1
0
 /**
  * @test
  */
 public function ignoreEmptyImage()
 {
     $image = EmptyImage::getInstance();
     $this->imagine->expects($this->never())->method('paste');
     $this->gc->drawImage($image, 50, 50, 100, 10);
     $this->gc->commit();
 }
Exemplo n.º 2
0
 public function createSource(Engine $engine)
 {
     try {
         return $engine->createImage($this->getAttribute('src'));
     } catch (InvalidResourceException $e) {
         if ($this->getAttribute('ignore-error')) {
             return EmptyImage::getInstance();
         }
         throw $e;
     }
 }
Exemplo n.º 3
0
 /**
  * @test
  */
 public function ignoreEmptyImage()
 {
     $zendPageMock = $this->getMockBuilder('\\ZendPdf\\Page')->setMethods(array('drawImage'))->disableOriginalConstructor()->disableOriginalClone()->getMock();
     $image = EmptyImage::getInstance();
     $zendPageMock->expects($this->never())->method('drawImage');
     $gc = $this->createGc(new Engine(), $zendPageMock);
     $gc->drawImage($image, 50, 50, 100, 10);
     $gc->commit();
 }