X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fbootstrap.php;h=b034b092beccbc80bee7841f480538cc4b9ea2d0;hb=537b74f3079a046750bc210bbd9e51c1187b361d;hp=875ec8ab7d5c5a4f2d1b808c972b1c48814eba0d;hpb=32418e8660af66fde215e576cef0e660a232ea92;p=friendica.git diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 875ec8ab7d..b034b092be 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,25 +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'; +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.'); +} -new App(dirname(__DIR__)); +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);