diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-12-04 18:44:26 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-04 18:44:26 -0500 |
commit | aab7344002fd390e5b62a3eb82f3a418fd294617 (patch) | |
tree | b214e7d4b3e9f0ca9818fea9e3d9efa0249c00c6 /plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php | |
parent | 1fd7e5e3794621993b01a5833faa8b6fa26c3847 (diff) | |
parent | 01b089d9be046db1253cb3bb90e8635b50fddd84 (diff) |
Merge branch 'minify' into 0.9.x
Diffstat (limited to 'plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php')
-rw-r--r-- | plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php b/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php new file mode 100644 index 000000000..1c182b5a3 --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Build.php @@ -0,0 +1,36 @@ +<?php +require_once '_inc.php'; + +require_once 'Minify/Build.php'; + +function test_Minify_Build() +{ + global $thisDir; + + $file1 = $thisDir . '/_test_files/css/paths_prepend.css'; + $file2 = $thisDir . '/_test_files/css/styles.css'; + $maxTime = max(filemtime($file1), filemtime($file2)); + + $b = new Minify_Build($file1); + assertTrue($b->lastModified == filemtime($file1) + ,'Minify_Build : single file path'); + + $b = new Minify_Build(array($file1, $file2)); + assertTrue($maxTime == $b->lastModified + ,'Minify_Build : multiple file paths'); + + require_once 'Minify.php'; + $b = new Minify_Build(array( + $file1 + ,new Minify_Source(array('filepath' => $file2)) + )); + + assertTrue($maxTime == $b->lastModified + ,'Minify_Build : file path and a Minify_Source'); + assertTrue($b->uri('/path') == "/path?{$maxTime}" + ,'Minify_Build : uri() with no querystring'); + assertTrue($b->uri('/path?hello') == "/path?hello&{$maxTime}" + ,'Minify_Build : uri() with existing querystring'); +} + +test_Minify_Build();
\ No newline at end of file |