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 / Helpers / WarningsIntoExceptionsTest.php

WarningsIntoExceptionsTest.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/Helpers/WarningsIntoExceptionsTest.php

65 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\Helpers;
4
5 use WebPConvert\Helpers\WarningsIntoExceptions;
6 use WebPConvert\Exceptions\WarningException;
7
8 use PHPUnit\Framework\TestCase;
9
10 class WarningsIntoExceptionsTest extends TestCase
11 {
12 public function testNothing()
13 {
14 $this->assertTrue(true);
15 }
16 /*
17 private static $imgDir = __DIR__ . '/../../images';
18
19 public function testUserWarning()
20 {
21 WarningsIntoExceptions::activate();
22
23 $this->expectException(WarningException::class);
24
25 // trigger user warning
26 trigger_error('warning test', E_USER_WARNING);
27
28 WarningsIntoExceptions::deactivate();
29 }
30
31
32 public function testWarning()
33 {
34 WarningsIntoExceptions::activate();
35
36 $this->expectException(WarningException::class);
37
38 // trigger build-in warning (chmod expects exactly two parameters)
39 chmod('hth');
40 WarningsIntoExceptions::deactivate();
41 }*/
42
43
44 /*
45 To suppress and capture output from exec calls, you need to redirect the stderr to stdout.
46 Otherwise it is "echoed to screen"
47
48
49 https://stackoverflow.com/questions/1606943/suppressing-output-from-exec-calls-in-php
50 public function testWarning2()
51 {
52 WarningsIntoExceptions::activate();
53
54 //$this->expectException(WarningException);
55
56 //ob_start();
57 exec('hahotehua 2>&1', $output, $returnCode);
58 //ob_end_clean();
59
60 WarningsIntoExceptions::deactivate();
61
62
63 }*/
64 }
65