mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 05:24:58 +09:00
* Update rector config to include tests * Run Rector against the tests * Delete test-results * Update .gitignore * Correctly set the PHP min to 8.1, split the configs * Corrected PHPDoc * Deleted tests we can't really get to pass PHPunit is hard-coded to fail when a class has a return type of `never`, which is the correct return type of our redirect function (and rightfully so). No way to disable the exception as far as we can tell
40 lines
1.2 KiB
PHP
40 lines
1.2 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, array(
|
|
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']();
|
|
|
|
//Setup the autoloader
|
|
$testsLoader = new AntCMS\AntLoader([
|
|
'mode' => 'filesystem'
|
|
]);
|
|
$testsLoader->addNamespace('', DIRECTORY_SEPARATOR . 'library', 'psr0');
|
|
$testsLoader->register();
|