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

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

- Page: https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/rosell-dk/webp-convert/tests/Convert/Converters/StackTest.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/3.2.5/raw/vendor/rosell-dk/webp-convert/tests/Convert/Converters/StackTest.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/StackTest.php#L10-L20`.

```php
<?php

namespace WebPConvert\Tests\Convert\Converters;

use WebPConvert\Convert\Converters\Stack;
use WebPConvert\Convert\Exceptions\ConversionFailed\ConverterNotOperationalException;
use WebPConvert\Convert\Exceptions\ConversionFailed\InvalidInput\ConverterNotFoundException;

use PHPUnit\Framework\TestCase;

class StackTest extends TestCase
{

    public static function getImageFolder()
    {
        return realpath(__DIR__ . '/../../images');
    }

    public static function getImagePath($image)
    {
        return self::getImageFolder() . '/' . $image;
    }

    /*
    public function testConvert()
    {
        //ConverterTestHelper::runAllConvertTests($this, 'Stack');
    }*/

    public function testConverterNotFound()
    {
        $this->expectException(ConverterNotFoundException::class);

        Stack::convert(
            self::getImagePath('test.jpg'),
            self::getImagePath('test.webp'),
            [
                'converters' => ['invalid-id']
            ]
        );
    }

    public function testCustomConverter()
    {
        Stack::convert(
            self::getImagePath('test.jpg'),
            self::getImagePath('test.webp'),
            [
                'converters' => [
                    '\\WebPConvert\\Tests\\Convert\\TestConverters\\SuccessGuaranteedConverter'
                ]
            ]
        );
        $this->addToAssertionCount(1);
    }

}

```
