| 1 |
<?php |
| 2 |
|
| 3 |
namespace Minify\Test; |
| 4 |
|
| 5 |
use Minify_Build; |
| 6 |
use Minify_Source; |
| 7 |
|
| 8 |
class MinifyBuildTest extends TestCase |
| 9 |
{ |
| 10 |
public function test() |
| 11 |
{ |
| 12 |
$file1 = self::$test_files . '/css/paths_prepend.css'; |
| 13 |
$file2 = self::$test_files . '/css/styles.css'; |
| 14 |
$maxTime = max(filemtime($file1), filemtime($file2)); |
| 15 |
|
| 16 |
$b = new Minify_Build($file1); |
| 17 |
$this->assertEquals($b->lastModified, filemtime($file1), 'single file path'); |
| 18 |
|
| 19 |
$b = new Minify_Build(array($file1, $file2)); |
| 20 |
$this->assertEquals($maxTime, $b->lastModified, 'multiple file paths'); |
| 21 |
|
| 22 |
$b = new Minify_Build(array($file1, new Minify_Source(array('filepath' => $file2)))); |
| 23 |
|
| 24 |
$this->assertEquals($maxTime, $b->lastModified, 'file path and a Minify_Source'); |
| 25 |
$this->assertEquals($b->uri('/path'), "/path?{$maxTime}", 'uri() with no querystring'); |
| 26 |
$this->assertEquals($b->uri('/path?hello'), "/path?hello&{$maxTime}", 'uri() with existing querystring'); |
| 27 |
} |
| 28 |
} |
| 29 |
|