mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-30 20:27:07 +09:00
* Restore needed gitignore * Ran the fixes since they are far behind * Fix for rector causing a problem. Re-ran. * Update ServiceTest.php
43 lines
1.3 KiB
PHP
43 lines
1.3 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('BB_DB_NAME', $config['db']['name']);
|
|
define('BB_DB_USER', $config['db']['user']);
|
|
define('BB_DB_PASSWORD', $config['db']['password']);
|
|
define('BB_DB_HOST', $config['db']['host']);
|
|
define('BB_DB_TYPE', $config['db']['type']);
|
|
|
|
// 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();
|