1
0
mirror of https://github.com/mrclay/minify.git synced 2025-09-02 10:22:50 +02:00

add test for #500

This commit is contained in:
Elan Ruusamäe
2016-01-20 13:21:11 +02:00
parent 7a73d781f2
commit c387014e27
5 changed files with 82 additions and 4 deletions

40
tests/LessSourceTest.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
class LessSourceTest extends TestCase
{
public function setUp()
{
$this->realDocRoot = $_SERVER['DOCUMENT_ROOT'];
$_SERVER['DOCUMENT_ROOT'] = self::$document_root;
}
/**
* @link https://github.com/mrclay/minify/issues/500
*/
public function testLessTimestamp()
{
$baseDir = self::$test_files;
$mainLess = "$baseDir/main.less";
$includedLess = "$baseDir/included.less";
// touch timestamp with 1s difference
touch($mainLess);
sleep(1);
touch($includedLess);
$mtime1 = filemtime($mainLess);
var_dump($mtime1);
$mtime2 = filemtime($includedLess);
var_dump($mtime2);
$max = max($mtime1, $mtime2);
$options = array(
'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php",
);
$res = Minify_HTML_Helper::getUri('less', $options);
$this->assertEquals("/min/g=less&amp;{$max}", $res);
}
}