X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=tests%2Fbootstrap.php;h=b034b092beccbc80bee7841f480538cc4b9ea2d0;hb=7d1a603ee5e028ab03a56f1512560cffc4aa1028;hp=a839dbed73c832fcfa8ab773bc154a6fd1b251a0;hpb=d41399496ed6d8f8a77f485aa0642e2b7ad779e9;p=friendica.git diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a839dbed73..b034b092be 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,11 +1,41 @@ . + * * This file is loaded by PHPUnit before any test. */ +use Dice\Dice; +use Friendica\DI; use PHPUnit\Framework\TestCase; +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.'); +} + +require __DIR__ . '/../vendor/autoload.php'; + // Backward compatibility if (!class_exists(TestCase::class)) { - class_alias(PHPUnit_Framework_TestCase::class, TestCase::class); + class_alias(\PHPUnit\Framework\TestCase::class, TestCase::class); } + +$dice = new Dice(); +$dice = $dice->addRules(include __DIR__ . '/../static/dependencies.config.php'); + +DI::init($dice);