]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Minify/extlib/minify/min_unit_tests/_inc.php
Added minify plugin
[quix0rs-gnu-social.git] / plugins / Minify / extlib / minify / min_unit_tests / _inc.php
1 <?php
2
3 require dirname(__FILE__) . '/../min/config.php';
4
5 set_include_path($min_libPath . PATH_SEPARATOR . get_include_path());
6
7 // set cache path and doc root if configured
8 $minifyCachePath = isset($min_cachePath) 
9     ? $min_cachePath 
10     : '';
11 if ($min_documentRoot) {
12     $_SERVER['DOCUMENT_ROOT'] = $min_documentRoot;
13 }
14
15 // default log to FirePHP
16 require_once 'Minify/Logger.php';
17 if ($min_errorLogger && true !== $min_errorLogger) { // custom logger
18     Minify_Logger::setLogger($min_errorLogger);
19 } else {
20     require_once 'FirePHP.php';
21     Minify_Logger::setLogger(FirePHP::getInstance(true));
22 }
23
24 error_reporting(E_ALL | E_STRICT);
25 ini_set('display_errors', 1);
26
27 header('Content-Type: text/plain');
28
29 $thisDir = dirname(__FILE__);
30
31 /**
32  * pTest - PHP Unit Tester
33  * @param mixed $test Condition to test, evaluated as boolean
34  * @param string $message Descriptive message to output upon test
35  * @url http://www.sitepoint.com/blogs/2007/08/13/ptest-php-unit-tester-in-9-lines-of-code/
36  */
37 function assertTrue($test, $message)
38 {
39         static $count;
40         if (!isset($count)) $count = array('pass'=>0, 'fail'=>0, 'total'=>0);
41
42         $mode = $test ? 'pass' : 'fail';
43         $outMode = $test ? 'PASS' : '!FAIL';
44         printf("%s: %s (%d of %d tests run so far have %sed)\n",
45                 $outMode, $message, ++$count[$mode], ++$count['total'], $mode);
46         
47         return (bool)$test;
48 }
49
50 ob_start();