public function run(rex_test_locator $locator, $colors = false) { $suite = new PHPUnit_Framework_TestSuite(); // disable backup of globals, since we have some rex_sql objectes referenced from variables in global space. // PDOStatements are not allowed to be serialized $suite->setBackupGlobals(false); $suite->addTestFiles($locator->getIterator()); rex_error_handler::unregister(); $runner = new PHPUnit_TextUI_TestRunner(); $backtrace = debug_backtrace(false); array_unshift($backtrace, ['file' => __FILE__, 'line' => __LINE__ + 3]); $runner->setPrinter(new rex_tests_result_printer($backtrace, $colors)); $result = $runner->doRun($suite); rex_error_handler::register(); return $result; }
require_once rex_path::core('functions/function_rex_other.php'); // ----------------- VERSION rex::setProperty('version', '5.0.0-alpha7'); $cacheFile = rex_path::cache('config.yml.cache'); $configFile = rex_path::data('config.yml'); if (file_exists($cacheFile) && file_exists($configFile) && filemtime($cacheFile) >= filemtime($configFile)) { $config = rex_file::getCache($cacheFile); } else { $config = array_merge(rex_file::getConfig(rex_path::core('default.config.yml')), rex_file::getConfig($configFile)); rex_file::putCache($cacheFile, $config); } foreach ($config as $key => $value) { if (in_array($key, ['fileperm', 'dirperm'])) { $value = octdec($value); } rex::setProperty($key, $value); } date_default_timezone_set(rex::getProperty('timezone', 'Europe/Berlin')); if (!rex::isSetup()) { rex_error_handler::register(); } // ----------------- REX PERMS rex_complex_perm::register('clang', 'rex_clang_perm'); // ----- SET CLANG if (!rex::isSetup()) { rex_clang::setCurrentId(rex_request('clang', 'int', rex_clang::getStartId())); } if (isset($REX['LOAD_PAGE']) && $REX['LOAD_PAGE']) { unset($REX); require rex_path::core(rex::isBackend() ? 'backend.php' : 'frontend.php'); }