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 / mrclay / minify / tests / MinifyLinesTest.php

MinifyLinesTest.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.5, at vendor/mrclay/minify/tests/MinifyLinesTest.php

48 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Minify\Test;
4
5 use Minify;
6 use Minify_Cache_Null;
7 use Minify_Controller_Files;
8 use Minify_Env;
9 use Minify_Source_Factory;
10
11 class MinifyLinesTest extends TestCase
12 {
13 public function test_lines()
14 {
15 $env = new Minify_Env(array(
16 'server' => array(
17 'DOCUMENT_ROOT' => dirname(__DIR__),
18 ),
19 ));
20 $sourceFactory = new Minify_Source_Factory($env, array(), new Minify_Cache_Null());
21 $controller = new Minify_Controller_Files($env, $sourceFactory);
22 $minify = new Minify(new Minify_Cache_Null());
23
24 $files = glob(self::$test_files . "/lines/*.in.js");
25
26 // uncomment to debug one
27 //$files = array(self::$test_files . "/lines/basic.in.js");
28
29 foreach ($files as $file) {
30 $ret = $minify->serve($controller, array(
31 'debug' => true,
32 'quiet' => true,
33 'encodeOutput' => false,
34 'files' => array($file),
35 ));
36
37 $outFile = str_replace('.in.js', '.out.js', $file);
38
39 $exp = file_get_contents($outFile);
40
41 // uncomment to set up expected output
42 //file_put_contents($outFile, $ret['content']);
43
44 $this->assertEquals($exp, $ret['content'], "Did not match: " . basename($outFile));
45 }
46 }
47 }
48