1
0
mirror of https://github.com/mrclay/minify.git synced 2025-01-17 13:18:13 +01:00
minify/tests/ScssSourceTest.php
Elan Ruusamäe eb4c0f6541 leafo/scssphp: allow 0.3/0.6/0.7
tests/ScssSourceTest.php passed with all versions

refs:
- commit ddf3a4e57f
- PR #562
2018-01-05 13:03:30 +02:00

42 lines
985 B
PHP

<?php
namespace Minify\Test;
use Minify_HTML_Helper;
class ScssSourceTest 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 testTimestamp()
{
$baseDir = self::$test_files;
$mainLess = "$baseDir/main.scss";
$includedLess = "$baseDir/_included.scss";
// touch timestamp with 1s difference
touch($mainLess);
sleep(1);
touch($includedLess);
$mtime1 = filemtime($mainLess);
$mtime2 = filemtime($includedLess);
$max = max($mtime1, $mtime2);
$options = array(
'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php",
);
$res = Minify_HTML_Helper::getUri('scss', $options);
$this->assertEquals("/min/g=scss&amp;{$max}", $res);
}
}