$value) { $GLOBALS[$key] = $value; } require $GLOBALS['STUDIP_BASE_PATH'] . '/config/config.inc.php';; require_once __DIR__ . '/../../lib/bootstrap-autoload.php'; // Do not send mails of any kind during tests StudipMail::setDefaultTransporter(StudipMail::DEBUG_TRANSPORTER); $GLOBALS['template_factory'] = new Flexi\Factory(dirname(dirname(__DIR__)) . '/templates'); // Disable caching to fallback to memory cache $GLOBALS['CACHING_ENABLE'] = false; // SimpleORMapFake if (!class_exists('StudipTestHelper')) { class StudipTestHelper { static function set_up_tables($tables) { $cache = \Studip\Cache\Factory::getCache(false); // second step, expire table scheme SimpleORMap::expireTableScheme(); $schemes = []; foreach ($tables as $db_table) { include TEST_FIXTURES_PATH."simpleormap/$db_table.php"; $db_fields = $pk = []; foreach ($result as $rs) { $db_fields[mb_strtolower($rs['name'])] = [ 'name' => $rs['name'], 'null' => $rs['null'], 'default' => $rs['default'], 'type' => $rs['type'], 'extra' => $rs['extra'] ]; if ($rs['key'] == 'PRI'){ $pk[] = mb_strtolower($rs['name']); } } $schemes[$db_table]['db_fields'] = $db_fields; $schemes[$db_table]['pk'] = $pk; } $cache->write('DB_TABLE_SCHEMES', serialize($schemes)); } static function tear_down_tables() { SimpleORMap::expireTableScheme(); } } }