PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.5
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.5
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / rosell-dk / webp-convert / tests / Convert / Converters / ImagickTest.php

ImagickTest.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/rosell-dk/webp-convert/tests/Convert/Converters/ImagickTest.php

64 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WebPConvert\Tests\Convert\Converters;
4
5 use WebPConvert\Convert\Converters\Imagick;
6
7 use PHPUnit\Framework\TestCase;
8
9 /**
10 * @coversDefaultClass WebPConvert\Convert\Converters\Imagick
11 * @covers WebPConvert\Convert\Converters\Imagick
12 */
13 class ImagickTest extends TestCase
14 {
15
16 public static $imageDir = __DIR__ . '/../../images/';
17
18 public function testConvert()
19 {
20 ConverterTestHelper::runAllConvertTests($this, 'Imagick');
21 }
22
23 /**
24 * @coversNothing
25 */
26 public function testQueryFormats()
27 {
28 if (!extension_loaded('imagick')) {
29 $this->markTestSkipped(
30 'The imagick extension is not available.'
31 );
32 return;
33 }
34 //if (!class_exists('\\Imagick')) {}
35
36 $im = new \Imagick();
37
38 $this->assertEquals(1, count($im->queryFormats('JPEG')));
39 $this->assertGreaterThan(2, count($im->queryFormats('*')));
40 $this->assertGreaterThan(2, count($im->queryFormats()));
41 $this->assertEquals(count($im->queryFormats('*')), count($im->queryFormats()));
42 }
43
44 /**
45 * @coversNothing
46 */
47 public function testThatImagickFunctionsUsedDoesNotThrow()
48 {
49 if (!extension_loaded('imagick')) {
50 $this->markTestSkipped(
51 'The imagick extension is not available.'
52 );
53 return;
54 }
55 $im = new \Imagick(self::$imageDir . '/test.jpg');
56 $im->setImageFormat('JPEG');
57 $im->stripImage();
58 $im->setImageCompressionQuality(100);
59 $imageBlob = $im->getImageBlob();
60
61 $this->addToAssertionCount(1);
62 }
63 }
64