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