1
0
mirror of https://github.com/mrclay/minify.git synced 2025-01-17 21:28:14 +01:00
minify/tests/MinifyBuildTest.php
2015-11-22 13:56:58 -05:00

23 lines
930 B
PHP

<?php
class MinifyBuildTest extends TestCase
{
public function test()
{
$file1 = self::$test_files . '/css/paths_prepend.css';
$file2 = self::$test_files . '/css/styles.css';
$maxTime = max(filemtime($file1), filemtime($file2));
$b = new Minify_Build($file1);
$this->assertEquals($b->lastModified, filemtime($file1), 'single file path');
$b = new Minify_Build(array($file1, $file2));
$this->assertEquals($maxTime, $b->lastModified, 'multiple file paths');
$b = new Minify_Build(array($file1, new Minify_Source(array('filepath' => $file2))));
$this->assertEquals($maxTime, $b->lastModified, 'file path and a Minify_Source');
$this->assertEquals($b->uri('/path'), "/path?{$maxTime}", 'uri() with no querystring');
$this->assertEquals($b->uri('/path?hello'), "/path?hello&amp;{$maxTime}", 'uri() with existing querystring');
}
}