Esempio n. 1
0
 /**
  * @covers \Imanee\ImageResource\GDResource::load
  * @group imanee-33
  * @dataProvider badColorProvider
  * @expectedException \Imanee\Exception\InvalidColorException
  */
 public function testLoadColourFailsWithBadInput($color)
 {
     $file = __DIR__ . '/_files/imanee.png';
     $gdResource = new GDResource();
     $gdResource->load($file);
     $this->assertFalse($gdResource->loadColor($color));
 }
Esempio n. 2
0
 /**
  * @covers \Imanee\ImageResource\GDResource::load
  * @group imanee-33
  * @dataProvider imageTypeProvider
  * @todo \Imanee\ImageResource\GDResource::load uses static method Imanee::getImageInfo
  */
 public function testLoadingImageCreatesAnImage($ext, $mime)
 {
     $file = __DIR__ . '/_files/imanee.' . $ext;
     $imageResource = new GDResource();
     $result = $imageResource->load($file);
     $this->assertSame($mime, $imageResource->mime);
     $this->assertSame($ext, $imageResource->format);
     $this->assertInstanceOf('\\Imanee\\ImageResource\\GDResource', $result);
     $this->assertSame($imageResource, $result);
 }
Esempio n. 3
0
 /**
  * @covers \Imanee\ImageResource\GDResource::output
  * @expectedException \Imanee\Exception\UnsupportedFormatException
  */
 public function testThrowErrorWhenFormatNotSupported()
 {
     $file = __DIR__ . '/_files/imanee.png';
     $gdResource = new GDResource();
     $gdResource->load($file);
     $gdResource->output('wrongFormat');
 }
Esempio n. 4
0
 /**
  * @expectedException Imanee\Exception\UnsupportedMethodException
  */
 public function testGetGifFramesShouldThrowExceptionAsUnsupported()
 {
     $imageResource = new GDResource();
     $imageResource->getGifFrames();
 }