1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-16 19:14:01 +02:00

port MinifyBuildTest to phpunit

This commit is contained in:
Elan Ruusamäe
2015-11-18 17:20:05 +02:00
committed by Steve Clay
parent 4bfe976916
commit 68f011d73f
3 changed files with 23 additions and 35 deletions

23
tests/MinifyBuildTest.php Normal file
View File

@@ -0,0 +1,23 @@
<?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');
}
}