public function testImageInfo() { $app = $this->getApp(); $handler = new ImageHandler($app); $result = $handler->imageInfo('generic-logo.png', false); $this->assertSame(624, $result['width']); $this->assertSame(351, $result['height']); $this->assertSame('jpeg', $result['type']); $this->assertSame('image/jpeg', $result['mime']); $this->assertRegExp('#1.7777#', (string) $result['aspectratio']); $this->assertSame('generic-logo.png', $result['filename']); $this->assertRegExp('#tests/phpunit/web-root/files/generic-logo.png#', $result['fullpath']); $this->assertSame('/files/generic-logo.png', $result['url']); $this->assertSame('', $result['exif']['latitude']); $this->assertFalse($result['exif']['longitude']); $this->assertFalse($result['exif']['datetime']); $this->assertFalse($result['exif']['orientation']); $this->assertRegExp('#1.7777#', (string) $result['exif']['aspectratio']); $this->asserttrue($result['landscape']); $this->assertFalse($result['portrait']); $this->assertFalse($result['square']); }
public function testImageInfo() { $app = $this->getApp(); $handler = new ImageHandler($app); $image = $handler->imageInfo('generic-logo.png', false); $this->assertInstanceOf(ImageInterface::class, $image); $this->assertInstanceOf(Image\Info::class, $image->getInfo()); }
public function testImageInfo() { $app = $this->getApp(); $handler = new ImageHandler($app); $result = $handler->imageInfo('generic-logo.png', false); $this->assertInstanceOf('Bolt\\Filesystem\\Handler\\Image\\Info', $result); $this->assertSame(624, $result->getWidth()); $this->assertSame(351, $result->getHeight()); $this->assertSame('JPEG', (string) $result->getType()); $this->assertSame('image/jpeg', $result->getMime()); $this->assertRegExp('#1.7777#', (string) $result->getAspectRatio()); $this->assertFalse($result->getExif()->getLatitude()); $this->assertFalse($result->getExif()->getLongitude()); $this->assertFalse($result->getExif()->getDatetime()); $this->assertFalse($result->getExif()->getOrientation()); $this->assertRegExp('#1.7777#', (string) $result->getExif()->getAspectRatio()); $this->asserttrue($result->isLandscape()); $this->assertFalse($result->isPortrait()); $this->assertFalse($result->isSquare()); }