X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2FFixtureTest.php;h=e2e8ad725a393ff6cd94331673dba163839dfede;hb=9fc26de628c609ea247011435e0f9673cf4d0011;hp=94b6a35b71286b1dd733f6c593efc28a3343b70d;hpb=1d5206d594a76297f36ecbaa85ac1ef46ba57c1d;p=friendica.git diff --git a/tests/FixtureTest.php b/tests/FixtureTest.php index 94b6a35b71..e2e8ad725a 100644 --- a/tests/FixtureTest.php +++ b/tests/FixtureTest.php @@ -1,6 +1,6 @@ dice = (new Dice()) - ->addRules(include __DIR__ . '/../static/dependencies.config.php') - ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true]) - ->addRule(IHandleSessions::class, ['instanceOf' => Session\Type\Memory::class, 'shared' => true, 'call' => null]) - ->addRule(Arguments::class, [ - 'instanceOf' => Arguments::class, - 'call' => [ - ['determine', [$server, $_GET], Dice::CHAIN_CALL], - ], - ]); - DI::init($this->dice); - - /** @var IManageConfigValues $config */ - $configCache = $this->dice->create(Cache::class); - $configCache->set('database', 'disable_pdo', true); - - /** @var Database $dba */ - $dba = $this->dice->create(Database::class); - - $dba->setTestmode(true); - - DBStructure::checkInitialValues(); - - // Load the API dataset for the whole API - $this->loadFixture(__DIR__ . '/datasets/api.fixture.php', $dba); + $this->setUpFixtures(); } - protected function useHttpMethod(string $method = Router::GET) + protected function tearDown(): void { - $server = $_SERVER; - $server['REQUEST_METHOD'] = $method; - - $this->dice = $this->dice - ->addRule(Arguments::class, [ - 'instanceOf' => Arguments::class, - 'call' => [ - ['determine', [$server, $_GET], Dice::CHAIN_CALL], - ], - ]); + $this->tearDownFixtures(); - DI::init($this->dice); + parent::tearDown(); } }