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 / StackTest.php

StackTest.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/StackTest.php

58 lines 1.4 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\Stack;
6 use WebPConvert\Convert\Exceptions\ConversionFailed\ConverterNotOperationalException;
7 use WebPConvert\Convert\Exceptions\ConversionFailed\InvalidInput\ConverterNotFoundException;
8
9 use PHPUnit\Framework\TestCase;
10
11 class StackTest extends TestCase
12 {
13
14 public static function getImageFolder()
15 {
16 return realpath(__DIR__ . '/../../images');
17 }
18
19 public static function getImagePath($image)
20 {
21 return self::getImageFolder() . '/' . $image;
22 }
23
24 /*
25 public function testConvert()
26 {
27 //ConverterTestHelper::runAllConvertTests($this, 'Stack');
28 }*/
29
30 public function testConverterNotFound()
31 {
32 $this->expectException(ConverterNotFoundException::class);
33
34 Stack::convert(
35 self::getImagePath('test.jpg'),
36 self::getImagePath('test.webp'),
37 [
38 'converters' => ['invalid-id']
39 ]
40 );
41 }
42
43 public function testCustomConverter()
44 {
45 Stack::convert(
46 self::getImagePath('test.jpg'),
47 self::getImagePath('test.webp'),
48 [
49 'converters' => [
50 '\\WebPConvert\\Tests\\Convert\\TestConverters\\SuccessGuaranteedConverter'
51 ]
52 ]
53 );
54 $this->addToAssertionCount(1);
55 }
56
57 }
58