X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fbootstrap.php;h=75c01f06f4c85503e8e1f593d28f7b57fca63135;hb=d658c811077b3d2e435c3b12035050ec7f84dfce;hp=6c04450b6a5175898c48adb0abc25caa79f2d547;hpb=47992d06cee2542b2c7cf00ad775bb91cb78b6cb;p=friendica.git diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6c04450b6a..75c01f06f4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,28 +1,41 @@ . + * * This file is loaded by PHPUnit before any test. */ -use Friendica\App; -use PHPUnit\DbUnit\DataSet\YamlDataSet; -use PHPUnit\DbUnit\TestCaseTrait; +use Dice\Dice; +use Friendica\DI; use PHPUnit\Framework\TestCase; -require_once __DIR__.'/../boot.php'; -require_once __DIR__.'/../include/api.php'; - -new App(dirname(__DIR__)); +if (!file_exists(__DIR__ . '/../vendor/autoload.php')) { + die('Vendor path not found. Please execute "bin/composer.phar --no-dev install" on the command line in the web root.'); +} -\Friendica\Core\Config::set('system', 'url', 'http://localhost'); -\Friendica\Core\Config::set('system', 'worker_dont_fork', true); +require __DIR__ . '/../vendor/autoload.php'; // Backward compatibility if (!class_exists(TestCase::class)) { - class_alias(PHPUnit_Framework_TestCase::class, TestCase::class); -} -if (!trait_exists(TestCaseTrait::class)) { - class_alias(PHPUnit_Extensions_Database_TestCase_Trait::class, TestCaseTrait::class); -} -if (!class_exists(YamlDataSet::class)) { - class_alias(PHPUnit_Extensions_Database_DataSet_YamlDataSet::class, YamlDataSet::class); + class_alias(\PHPUnit\Framework\TestCase::class, TestCase::class); } + +$dice = new Dice(); +$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php'); + +DI::init($dice);