mirror of
https://github.com/mrclay/minify.git
synced 2025-08-19 12:21:20 +02:00
port MinifyLinesTest to phpunit
This commit is contained in:
29
tests/MinifyLinesTest.php
Normal file
29
tests/MinifyLinesTest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
class MinifyLinesTest extends TestCase
|
||||
{
|
||||
public function test_lines()
|
||||
{
|
||||
$exp = file_get_contents(self::$test_files . "/minify/lines_output.js");
|
||||
|
||||
$env = new Minify_Env(array(
|
||||
'server' => array(
|
||||
'DOCUMENT_ROOT' => dirname(__DIR__),
|
||||
),
|
||||
));
|
||||
$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(
|
||||
'debug' => true
|
||||
,'quiet' => true
|
||||
,'encodeOutput' => false
|
||||
,'files' => array(
|
||||
self::$test_files . "/js/before.js"
|
||||
)
|
||||
));
|
||||
|
||||
$this->assertEquals($exp, $ret['content']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user