From 01b089d9be046db1253cb3bb90e8635b50fddd84 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Fri, 4 Dec 2009 12:36:00 -0500 Subject: Added minify plugin --- .../minify/min_unit_tests/test_environment.php | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 plugins/Minify/extlib/minify/min_unit_tests/test_environment.php (limited to 'plugins/Minify/extlib/minify/min_unit_tests/test_environment.php') diff --git a/plugins/Minify/extlib/minify/min_unit_tests/test_environment.php b/plugins/Minify/extlib/minify/min_unit_tests/test_environment.php new file mode 100644 index 000000000..f80156905 --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/test_environment.php @@ -0,0 +1,100 @@ + array( + 'method' => "GET", + 'header' => "Accept-Encoding: deflate, gzip\r\n" + ) + ))); + + $meta = stream_get_meta_data($fp); + + $passed = true; + foreach ($meta['wrapper_data'] as $i => $header) { + if ((preg_match('@^Content-Length: (\\d+)$@i', $header, $m) && $m[1] !== '6') + || preg_match('@^Content-Encoding:@i', $header, $m) + ) { + $passed = false; + break; + } + } + if ($passed && stream_get_contents($fp) !== 'World!') { + $passed = false; + } + assertTrue( + $passed + ,'environment : PHP/server does not auto-HTTP-encode content' + ); + fclose($fp); + + if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) { + if (! $passed) { + echo "\nReturned content should be 6 bytes and not HTTP encoded.\n" + . "Headers returned by: {$thisUrl}?hello=1\n\n"; + var_export($meta['wrapper_data']); + } + } +} + +test_environment(); -- cgit v1.2.3-54-g00ecf