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

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

47 lines 1.0 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_HTML_Helper;
6
7 /**
8 * @requires php < 7.3
9 * @see https://github.com/mrclay/minify/pull/685
10 */
11 class LessSourceTest extends TestCase
12 {
13 public function setUp()
14 {
15 $this->realDocRoot = $_SERVER['DOCUMENT_ROOT'];
16 $_SERVER['DOCUMENT_ROOT'] = self::$document_root;
17 }
18
19 /**
20 * @link https://github.com/mrclay/minify/issues/500
21 */
22 public function testLessTimestamp()
23 {
24 $baseDir = self::$test_files;
25
26 $mainLess = "$baseDir/main.less";
27 $includedLess = "$baseDir/included.less";
28
29 // touch timestamp with 1s difference
30 touch($mainLess);
31 sleep(1);
32 touch($includedLess);
33
34 $mtime1 = filemtime($mainLess);
35 $mtime2 = filemtime($includedLess);
36
37 $max = max($mtime1, $mtime2);
38
39 $options = array(
40 'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php",
41 );
42 $res = Minify_HTML_Helper::getUri('less', $options);
43
44 $this->assertEquals("/min/g=less&amp;{$max}", $res);
45 }
46 }
47