- $server = $_SERVER;
- $server['REQUEST_METHOD'] = Router::GET;
-
- $this->dice = (new Dice())
- ->addRules(include __DIR__ . '/../static/dependencies.config.php')
- ->addRule(ConfigFileManager::class, [
- 'instanceOf' => Config::class,
- 'call' => [['createConfigFileManager', [$this->root->url(), $server,],
- Dice::CHAIN_CALL]]])
- ->addRule(Database::class, ['instanceOf' => StaticDatabase::class, 'shared' => true])
- ->addRule(IHandleSessions::class, ['instanceOf' => Memory::class, 'shared' => true, 'call' => null])
- ->addRule(Arguments::class, [
- 'instanceOf' => Arguments::class,
- 'call' => [
- ['determine', [$server, $_GET], Dice::CHAIN_CALL],
- ],
- ]);
- DI::init($this->dice);
-
- $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);