} else { die("Class {$class} not found in {$file}.\n"); } } ini_set('error_log', dirname(__FILE__) . '/tests.log'); ini_set('display_errors', 1); return $suite; } } /** * Возвращает контекст для использования в тестах. */ function get_test_context() { static $ctx = null; if (null === $ctx) { $ctx = Context::yesIKnowThisIsStrangeButIWantANewInstance(array('url' => 'http://test.cms.molinos.ru/')); } return $ctx; } try { if (file_exists($db = os::path('conf', 'test.db'))) { unlink($db); } copy(os::path('conf', 'default.db.dist'), $db); if (PHPUnit_MAIN_METHOD == 'AllTests::main') { AllTests::main(); } } catch (Exception $e) { printf("%s: %s\n%s\n", get_class($e), $e->getMessage(), mcms::backtrace($e)); }