Files
FOSSBilling/tests-legacy/bootstrap.php
T
Adam Daley 96659a195c Refactor cookie management and clean up legacy (#3308)
* Remove manual unsetting of `BOXADMR` cookie

* Rename locale cookie `BBLANG` to `fb_locale`

* Rename session name to `fb_sid`

* Tidy comments in `config-sample.php`

* Remove legacy `bb-ipn.php` rewrite rule

* Remove legacy BB params and file migration check

* Remove header comments from `robots.txt`

* Update SQL dump header database name

* Use `FB_*` DB constants and add DB port
2026-03-10 08:42:11 +00:00

44 lines
1.4 KiB
PHP

<?php
putenv('APP_ENV=test');
define('PATH_TESTS', __DIR__);
require_once __DIR__ . '/../src/load.php';
require_once __DIR__ . '/../src/vendor/autoload.php';
$config = include __DIR__ . '/../src/config.php';
define('FB_DB_NAME', $config['db']['name']);
define('FB_DB_USER', $config['db']['user']);
define('FB_DB_PASSWORD', $config['db']['password']);
define('FB_DB_HOST', $config['db']['host']);
define('FB_DB_TYPE', $config['db']['driver']);
define('FB_DB_PORT', $config['db']['port'] ?? '3306');
// Add test libraries
set_include_path(implode(PATH_SEPARATOR, [
get_include_path(),
PATH_TESTS . '/library',
PATH_TESTS . '/includes',
PATH_TESTS . '/includes/Vps',
]));
require_once 'BBTestCase.php';
require_once 'BBDatabaseTestCase.php';
require_once 'BBDbApiTestCase.php';
require_once 'ApiTestCase.php';
require_once 'BBModTestCase.php';
require_once PATH_TESTS . '/includes/Payment/Adapter/Dummy.php';
require_once 'FakeTemplateWrapper.php';
require_once 'DummyBean.php';
$di = include PATH_ROOT . '/di.php';
$di['translate']();
$di['validator'] = (fn (): FOSSBilling\Validate => new FOSSBilling\Validate());
$di['tools'] = (fn (): FOSSBilling\Tools => new FOSSBilling\Tools());
// Setup the autoloader
$testsLoader = new AntCMS\AntLoader([
'mode' => 'filesystem',
]);
$testsLoader->addNamespace('', DIRECTORY_SEPARATOR . 'library', 'psr0');
$testsLoader->register();