diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-12-04 12:36:00 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-04 12:36:00 -0500 |
commit | 01b089d9be046db1253cb3bb90e8635b50fddd84 (patch) | |
tree | 2a4cee14992807cbe19901743d48bc1447729a35 /plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder | |
parent | 40afc7e9877855272caa5c65fb3575e4420b2966 (diff) |
Added minify plugin
Diffstat (limited to 'plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder')
-rw-r--r-- | plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/green.png | bin | 0 -> 202 bytes | |||
-rw-r--r-- | plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/index.php | 60 |
2 files changed, 60 insertions, 0 deletions
diff --git a/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/green.png b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/green.png Binary files differnew file mode 100644 index 000000000..d9d3a308a --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/green.png diff --git a/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/index.php b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/index.php new file mode 100644 index 000000000..c9a391d07 --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/HTTP_Encoder/index.php @@ -0,0 +1,60 @@ +<?php +ini_set('display_errors', 'on'); + +set_include_path(get_include_path() . PATH_SEPARATOR . realpath(dirname(__FILE__) . '/../../min/lib')); +require 'HTTP/Encoder.php'; + +if (!isset($_GET['test'])) { + $type = 'text/html'; + ob_start(); +?> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" +"http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<title>HTTP_Encoder Test</title> +<style type="text/css"> +@import "?test=2"; +#img {background:url("?test=1");} +.green {background:#0f0;} +p span {padding:0 .5em;} +</style> +</head> +<body> +<h1>HTTP_Encoder test</h1> +<p><span class="green"> HTML </span></p> +<p><span id="css"> CSS </span></p> +<p><span id="js"> Javascript </span></p> +<p><span id="img"> image </span></p> +<script src="?test=3" type="text/javascript"></script> +</body> +</html> +<?php + $content = ob_get_contents(); + ob_end_clean(); + +} elseif ($_GET['test'] == '1') { + $content = file_get_contents(dirname(__FILE__) . '/green.png'); + $type = 'image/png'; + +} elseif ($_GET['test'] == '2') { + $content = '#css {background:#0f0;}'; + $type = 'text/css'; + +} else { + $content = ' +window.onload = function(){ + document.getElementById("js").className = "green"; +}; + '; + $type = 'application/x-javascript'; +} + +$he = new HTTP_Encoder(array( + 'content' => $content + ,'type' => $type +)); +$he->encode(); +$he->sendAll(); + +?>
\ No newline at end of file |