# wp-optimize/3.2.5/vendor/rosell-dk/webp-convert/tests/Convert/Converters/ImagickTest.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 3.2.5. 64 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/rosell-dk/webp-convert/tests/Convert/Converters/ImagickTest.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/3.2.5/raw/vendor/rosell-dk/webp-convert/tests/Convert/Converters/ImagickTest.php
- Modified: 2022-06-03T18:20:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/rosell-dk/webp-convert/tests/Convert/Converters/ImagickTest.php#L10-L20`.

```php
<?php

namespace WebPConvert\Tests\Convert\Converters;

use WebPConvert\Convert\Converters\Imagick;

use PHPUnit\Framework\TestCase;

/**
 * @coversDefaultClass WebPConvert\Convert\Converters\Imagick
 * @covers WebPConvert\Convert\Converters\Imagick
 */
class ImagickTest extends TestCase
{

    public static $imageDir = __DIR__ . '/../../images/';

    public function testConvert()
    {
        ConverterTestHelper::runAllConvertTests($this, 'Imagick');
    }

    /**
     * @coversNothing
     */
    public function testQueryFormats()
    {
        if (!extension_loaded('imagick')) {
            $this->markTestSkipped(
              'The imagick extension is not available.'
            );
            return;
        }
        //if (!class_exists('\\Imagick')) {}

        $im = new \Imagick();

        $this->assertEquals(1, count($im->queryFormats('JPEG')));
        $this->assertGreaterThan(2, count($im->queryFormats('*')));
        $this->assertGreaterThan(2, count($im->queryFormats()));
        $this->assertEquals(count($im->queryFormats('*')), count($im->queryFormats()));
    }

    /**
     * @coversNothing
     */
    public function testThatImagickFunctionsUsedDoesNotThrow()
    {
        if (!extension_loaded('imagick')) {
            $this->markTestSkipped(
              'The imagick extension is not available.'
            );
            return;
        }
        $im = new \Imagick(self::$imageDir . '/test.jpg');
        $im->setImageFormat('JPEG');
        $im->stripImage();
        $im->setImageCompressionQuality(100);
        $imageBlob = $im->getImageBlob();

        $this->addToAssertionCount(1);
    }
}

```
