2008-08-29 22:56:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once '_inc.php';
|
|
|
|
|
|
|
|
function test_Lines()
|
|
|
|
{
|
|
|
|
global $thisDir;
|
|
|
|
|
|
|
|
$exp = file_get_contents("{$thisDir}/_test_files/minify/lines_output.js");
|
|
|
|
|
2015-09-28 15:36:52 -04:00
|
|
|
$env = new Minify_Env();
|
|
|
|
$sourceFactory = new Minify_Source_Factory($env, array(), new Minify_Cache_Null());
|
|
|
|
$controller = new Minify_Controller_Files($env, $sourceFactory);
|
|
|
|
$minify = new Minify(new Minify_Cache_Null());
|
|
|
|
|
|
|
|
$ret = $minify->serve($controller, array(
|
2008-08-29 22:56:34 +00:00
|
|
|
'debug' => true
|
|
|
|
,'quiet' => true
|
|
|
|
,'encodeOutput' => false
|
|
|
|
,'files' => array(
|
2013-03-29 13:26:10 -04:00
|
|
|
"{$thisDir}/_test_files/js/before.js"
|
2008-08-29 22:56:34 +00:00
|
|
|
)
|
|
|
|
));
|
|
|
|
|
|
|
|
$passed = assertTrue($exp === $ret['content'], 'Minify_Lines');
|
|
|
|
|
|
|
|
if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
|
2010-05-16 01:27:33 +00:00
|
|
|
echo "\n---Output: " .countBytes($ret['content']). " bytes\n\n{$ret['content']}\n\n";
|
2008-08-29 22:56:34 +00:00
|
|
|
if (!$passed) {
|
2010-05-16 01:27:33 +00:00
|
|
|
echo "---Expected: " .countBytes($exp). " bytes\n\n{$exp}\n\n\n";
|
2008-08-29 22:56:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-30 19:46:23 +00:00
|
|
|
test_Lines();
|