Files
nat-as-server/tests/bootstrap.php
Tom Hempel 810ed24792
Some checks failed
PHPUnit / test (push) Has been cancelled
migration to mysql
2026-07-10 09:57:44 +02:00

31 lines
874 B
PHP

<?php
declare(strict_types=1);
define('QDB_TESTING', true);
define('QDB_TEST_UPLOADS', __DIR__ . '/runtime/uploads');
$runtimeRoot = dirname(QDB_TEST_UPLOADS);
if (!is_dir($runtimeRoot)) {
mkdir($runtimeRoot, 0755, true);
}
if (!is_dir(QDB_TEST_UPLOADS)) {
mkdir(QDB_TEST_UPLOADS, 0755, true);
}
putenv('QDB_API_LOG_DIR=' . QDB_TEST_UPLOADS . '/logs/api');
$_ENV['QDB_API_LOG_DIR'] = QDB_TEST_UPLOADS . '/logs/api';
$testMasterKey = base64_encode(str_repeat('T', 32));
require dirname(__DIR__) . '/vendor/autoload.php';
require_once dirname(__DIR__) . '/lib/response.php';
require_once dirname(__DIR__) . '/common.php';
qdb_env_override('QDB_DRIVER', 'sqlite');
// Always use the test key, even when .env defines QDB_MASTER_KEY (avoids decrypt/seed drift).
qdb_env_override('QDB_MASTER_KEY', $testMasterKey);
require_once dirname(__DIR__) . '/db_init.php';