{ $show = (bool) (error_reporting() & $errno); if (!$show) { return; } throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } public static function get_tests() { $tests = array(); foreach (glob(Gorilla::$path . '/lib/tests/*.php') as $file) { $name = str_replace(Gorilla::$path . '/lib/tests/', '', $file); $name = str_replace('.php', '', $name); $tests[] = $name; } return $tests; } public static function load_phpunit() { if (!class_exists('PHPUnit_TestCase')) { include 'PHPUnit/Autoload.php'; if (!function_exists('phpunit_autoload')) { throw new Exception('PHPUnit could not be loaded'); } } } } Gorilla::$path = dirname(dirname(dirname(__FILE__))); spl_autoload_register(array('Gorilla', 'autoload')); Gorilla::load_phpunit(); set_exception_handler(array('Gorilla', 'exception'));