1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-06 22:26:28 +02:00

port MinifyHTMLTest to phpunit

This commit is contained in:
Elan Ruusamäe
2015-11-19 19:21:32 +02:00
committed by Steve Clay
parent 16b8296c34
commit 6e7767aa3e
3 changed files with 30 additions and 56 deletions

30
tests/MinifyHTMLTest.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
class MinifyHTMLTest extends TestCase
{
public function test1()
{
$src = file_get_contents(self::$test_files . '/html/before.html');
$minExpected = file_get_contents(self::$test_files . '/html/before.min.html');
$minOutput = Minify_HTML::minify($src, array(
'cssMinifier' => array('Minify_CSSmin', 'minify'),
'jsMinifier' => array('JSMin\\JSMin', 'minify'),
));
$this->assertEquals($minExpected, $minOutput);
}
public function test2()
{
$src = file_get_contents(self::$test_files . '/html/before2.html');
$minExpected = file_get_contents(self::$test_files . '/html/before2.min.html');
$minOutput = Minify_HTML::minify($src, array(
'cssMinifier' => array('Minify_CSSmin', 'minify'),
'jsMinifier' => array('JSMin\\JSMin', 'minify'),
));
$this->assertEquals($minExpected, $minOutput);
}
}