예제 #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));
 }
예제 #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);
 }
예제 #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');
 }
예제 #4
0
 /**
  * @expectedException Imanee\Exception\UnsupportedMethodException
  */
 public function testGetGifFramesShouldThrowExceptionAsUnsupported()
 {
     $imageResource = new GDResource();
     $imageResource->getGifFrames();
 }