mirror of
https://github.com/mrclay/minify.git
synced 2025-09-01 18:02:54 +02:00
HTTP/Encoder.php : by default no longer encodes to IE6, + setting to do so
importProcessor/output.css : fixed to work portably
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
@media screen {
|
||||
/* some CSS to try to exercise things in general */
|
||||
|
||||
@import url(/_3rd_party/minify/min_extras/unit_tests/_test_files/css/more.css);
|
||||
@import url(%TEST_FILES_URI%/css/more.css);
|
||||
|
||||
body, td, th {
|
||||
font-family: Verdana , "Bitstream Vera Sans" , sans-serif ;
|
||||
@@ -32,17 +32,17 @@ h1 + p {
|
||||
}
|
||||
@import url(http://example.com/hello.css);
|
||||
adjacent foo { background: red url(/red.gif); }
|
||||
adjacent bar { background: url('/_3rd_party/minify/min_extras/unit_tests/_test_files/importProcessor/../green.gif') }
|
||||
adjacent bar { background: url('%TEST_FILES_URI%/importProcessor/../green.gif') }
|
||||
}
|
||||
|
||||
@media tv,projection {
|
||||
/* @import url('/_3rd_party/minify/min_extras/unit_tests/_test_files/importProcessor/1/bad.css') bad; */
|
||||
/* @import url('%TEST_FILES_URI%/importProcessor/1/bad.css') bad; */
|
||||
adjacent2 foo { background: red url(/red.gif); }
|
||||
adjacent2 bar { background: url('/_3rd_party/minify/min_extras/unit_tests/_test_files/importProcessor/1/../green.gif') }
|
||||
adjacent2 bar { background: url('%TEST_FILES_URI%/importProcessor/1/../green.gif') }
|
||||
@import '../input.css';
|
||||
tv foo { background: red url(/red.gif); }
|
||||
tv bar { background: url('/_3rd_party/minify/min_extras/unit_tests/_test_files/importProcessor/1/../green.gif') }
|
||||
tv bar { background: url('%TEST_FILES_URI%/importProcessor/1/../green.gif') }
|
||||
}
|
||||
|
||||
input foo { background: red url(/red.gif); }
|
||||
input bar { background: url('/_3rd_party/minify/min_extras/unit_tests/_test_files/importProcessor/../green.gif') }
|
||||
input bar { background: url('%TEST_FILES_URI%/importProcessor/../green.gif') }
|
@@ -7,6 +7,7 @@ function test_HTTP_Encoder()
|
||||
{
|
||||
global $thisDir;
|
||||
|
||||
HTTP_Encoder::$encodeToIe6 = true;
|
||||
$methodTests = array(
|
||||
array(
|
||||
'ua' => 'Any browser'
|
||||
@@ -51,7 +52,28 @@ function test_HTTP_Encoder()
|
||||
,'desc' => 'Opera identifying as IE6'
|
||||
)
|
||||
);
|
||||
|
||||
foreach ($methodTests as $test) {
|
||||
$_SERVER['HTTP_USER_AGENT'] = $test['ua'];
|
||||
$_SERVER['HTTP_ACCEPT_ENCODING'] = $test['ae'];
|
||||
$exp = $test['exp'];
|
||||
$ret = HTTP_Encoder::getAcceptedEncoding();
|
||||
$passed = assertTrue($exp == $ret, 'HTTP_Encoder : ' . $test['desc']);
|
||||
|
||||
if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
|
||||
echo "\n--- AE | UA = {$test['ae']} | {$test['ua']}\n";
|
||||
echo "Expected = " . preg_replace('/\\s+/', ' ', var_export($exp, 1)) . "\n";
|
||||
echo "Returned = " . preg_replace('/\\s+/', ' ', var_export($ret, 1)) . "\n\n";
|
||||
}
|
||||
}
|
||||
HTTP_Encoder::$encodeToIe6 = false;
|
||||
$methodTests = array(
|
||||
array(
|
||||
'ua' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)'
|
||||
,'ae' => 'gzip, deflate'
|
||||
,'exp' => array('', '')
|
||||
,'desc' => 'IE6 w/ "enhanced security"'
|
||||
)
|
||||
);
|
||||
foreach ($methodTests as $test) {
|
||||
$_SERVER['HTTP_USER_AGENT'] = $test['ua'];
|
||||
$_SERVER['HTTP_ACCEPT_ENCODING'] = $test['ae'];
|
||||
|
Reference in New Issue
Block a user