mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-09 21:43:22 +09:00
* Replace composer's dev autoloader with AntLoader This way, people don't need to specifically remember to remove dev deps before uploading to a server. * Move to the tests bootstrap file
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
define('APPLICATION_ENV', 'testing');
|
|
define('PATH_TESTS', dirname(__FILE__));
|
|
require_once dirname(__FILE__) . '/../src/load.php';
|
|
$config = include dirname(__FILE__) . '/../src/config.php';
|
|
|
|
require_once dirname(__FILE__) . '/../src/vendor/autoload.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();
|
|
$testsLoader->addPrefix('', DIRECTORY_SEPARATOR . 'library', 'psr0');
|
|
$testsLoader->register();
|