From ae4b49fcee650ab624ffcb2264f3102629b2db5a Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Sun, 22 Nov 2015 12:25:08 -0500 Subject: [PATCH] port MinifyLinesTest to phpunit --- min_unit_tests/test_Minify_Lines.php | 35 ---------------------------- min_unit_tests/test_all.php | 1 - tests/MinifyLinesTest.php | 29 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 36 deletions(-) delete mode 100644 min_unit_tests/test_Minify_Lines.php create mode 100644 tests/MinifyLinesTest.php diff --git a/min_unit_tests/test_Minify_Lines.php b/min_unit_tests/test_Minify_Lines.php deleted file mode 100644 index be9fc93..0000000 --- a/min_unit_tests/test_Minify_Lines.php +++ /dev/null @@ -1,35 +0,0 @@ -serve($controller, array( - 'debug' => true - ,'quiet' => true - ,'encodeOutput' => false - ,'files' => array( - "{$thisDir}/_test_files/js/before.js" - ) - )); - - $passed = assertTrue($exp === $ret['content'], 'Minify_Lines'); - - if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) { - echo "\n---Output: " .countBytes($ret['content']). " bytes\n\n{$ret['content']}\n\n"; - if (!$passed) { - echo "---Expected: " .countBytes($exp). " bytes\n\n{$exp}\n\n\n"; - } - } -} - -test_Lines(); \ No newline at end of file diff --git a/min_unit_tests/test_all.php b/min_unit_tests/test_all.php index db9abed..0586365 100644 --- a/min_unit_tests/test_all.php +++ b/min_unit_tests/test_all.php @@ -2,5 +2,4 @@ require 'test_Minify.php'; require 'test_Minify_CSS.php'; -require 'test_Minify_Lines.php'; require 'test_environment.php'; diff --git a/tests/MinifyLinesTest.php b/tests/MinifyLinesTest.php new file mode 100644 index 0000000..6e93434 --- /dev/null +++ b/tests/MinifyLinesTest.php @@ -0,0 +1,29 @@ + 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']); + } +}