mirror of
https://github.com/mrclay/minify.git
synced 2025-07-31 19:30:29 +02:00
Clean up unit test messages
This commit is contained in:
@@ -9,7 +9,7 @@ function test_Minify_Cache_File()
|
|||||||
|
|
||||||
$cache = new Minify_Cache_File();
|
$cache = new Minify_Cache_File();
|
||||||
|
|
||||||
echo "NOTE: Minify_Cache_File : path is set to: '" . $cache->getPath() . "'.\n";
|
echo " Minify_Cache_File : path is set to: '" . $cache->getPath() . "'.\n";
|
||||||
|
|
||||||
assertTrue(true === $cache->store($id, $data), $prefix . 'store');
|
assertTrue(true === $cache->store($id, $data), $prefix . 'store');
|
||||||
|
|
||||||
|
@@ -8,14 +8,14 @@ function test_Minify_Cache_Memcache()
|
|||||||
|
|
||||||
if (! function_exists('memcache_set')) {
|
if (! function_exists('memcache_set')) {
|
||||||
if ($thisFileActive) {
|
if ($thisFileActive) {
|
||||||
echo "NOTE: {$prefix}PHP lacks memcache support\n";
|
echo " {$prefix}To test this component, install memcache in PHP\n";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$mc = new Memcache;
|
$mc = new Memcache;
|
||||||
if (! @$mc->connect('localhost', 11211)) {
|
if (! @$mc->connect('localhost', 11211)) {
|
||||||
if ($thisFileActive) {
|
if ($thisFileActive) {
|
||||||
echo "NOTE: {$prefix}Could not connect to localhost:11211\n";
|
echo " {$prefix}Memcache server not found on localhost:11211\n";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -65,10 +65,10 @@ function test_Minify_ClosureCompiler()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
echo "NONE: Minify_ClosureCompiler : Please download a compiler.jar from
|
echo " Minify_ClosureCompiler : To test more functionality, download a compiler.jar from\n";
|
||||||
https://code.google.com/p/closure-compiler/wiki/BinaryDownloads
|
echo " https://code.google.com/p/closure-compiler/wiki/BinaryDownloads,\n";
|
||||||
put it under '${compiler_jar_path}' and make it readable by your webserver
|
echo " put it under '${compiler_jar_path}',\n";
|
||||||
to test more functionality\n";
|
echo " and make it readable by your webserver\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ function test_Minify_JS_ClosureCompiler()
|
|||||||
$minExpected = "(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);";
|
$minExpected = "(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);";
|
||||||
$minOutput = Minify_JS_ClosureCompiler::minify($src);
|
$minOutput = Minify_JS_ClosureCompiler::minify($src);
|
||||||
if (false !== strpos($minOutput, 'Error(22): Too many compiles')) {
|
if (false !== strpos($minOutput, 'Error(22): Too many compiles')) {
|
||||||
echo "!NOTE: Too many recent calls to Closure Compiler API to test.\n";
|
echo "!---: Minify_JS_ClosureCompiler : Too many recent calls to Closure Compiler API to test.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ function test_Minify_YuiCSS()
|
|||||||
$minOutput = Minify_YUICompressor::minifyCss($src);
|
$minOutput = Minify_YUICompressor::minifyCss($src);
|
||||||
assertTrue(false, "Expected exception Not thrown");
|
assertTrue(false, "Expected exception Not thrown");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
assertTrue($e->getMessage() == 'Minify_YUICompressor : YUI compressor execution failed.', 'got expected Exception');
|
assertTrue($e->getMessage() == 'Minify_YUICompressor : YUI compressor execution failed.', 'Minify_YUICompressor : got expected Exception');
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -43,11 +43,11 @@ function test_environment()
|
|||||||
. "cannot modify this, consider setting \$min_documentRoot in config.php\n\n";
|
. "cannot modify this, consider setting \$min_documentRoot in config.php\n\n";
|
||||||
}
|
}
|
||||||
if (isset($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'])) {
|
if (isset($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'])) {
|
||||||
echo "\n!NOTE: environment : \$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] is set. "
|
echo "\n environment : \$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] is set. "
|
||||||
. "You may need to set \$min_documentRoot to this in config.php\n";
|
. "You may need to set \$min_documentRoot to this in config.php\n";
|
||||||
}
|
}
|
||||||
if (realpath(__FILE__) !== realpath($_SERVER['DOCUMENT_ROOT'] . '/min_unit_tests/test_environment.php')) {
|
if (realpath(__FILE__) !== realpath($_SERVER['DOCUMENT_ROOT'] . '/min_unit_tests/test_environment.php')) {
|
||||||
echo "!NOTE: environment : /min_unit_tests/ is not directly inside DOCUMENT_ROOT\n";
|
echo " environment : /min_unit_tests/ is not directly inside DOCUMENT_ROOT\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$thisUrl = 'http://'
|
$thisUrl = 'http://'
|
||||||
@@ -59,11 +59,11 @@ function test_environment()
|
|||||||
$oc = @file_get_contents($thisUrl . '?getOutputCompression=1');
|
$oc = @file_get_contents($thisUrl . '?getOutputCompression=1');
|
||||||
|
|
||||||
if (false === $oc || ! preg_match('/^[01]$/', $oc)) {
|
if (false === $oc || ! preg_match('/^[01]$/', $oc)) {
|
||||||
echo "!WARN: environment : Local HTTP request failed. Testing cannot continue.\n";
|
echo "!---: environment : Local HTTP request failed. Testing cannot continue.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ('1' === $oc) {
|
if ('1' === $oc) {
|
||||||
echo "!WARN: environment : zlib.output_compression is enabled in php.ini"
|
echo "!---: environment : zlib.output_compression is enabled in php.ini"
|
||||||
. " or .htaccess.\n";
|
. " or .htaccess.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,9 +88,9 @@ function test_environment()
|
|||||||
if (! $passed) {
|
if (! $passed) {
|
||||||
$testFake = _test_environment_getHello($thisUrl . '?hello=faketype');
|
$testFake = _test_environment_getHello($thisUrl . '?hello=faketype');
|
||||||
if ($testFake['length'] == 6) {
|
if ($testFake['length'] == 6) {
|
||||||
echo "!NOTE: environment : Server does not auto-encode arbitrary types. This\n"
|
echo " environment : Server does not auto-encode arbitrary types. This\n"
|
||||||
. " may indicate that the auto-encoding is caused by Apache's \n"
|
. " may indicate that the auto-encoding is caused by Apache's\n"
|
||||||
. " AddOutputFilterByType.";
|
. " AddOutputFilterByType.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user