diff --git a/index.php b/index.php index a9d4135b16..ce6daa5edb 100644 --- a/index.php +++ b/index.php @@ -29,6 +29,11 @@ $dice = $dice->addRule(Friendica\App\Mode::class, ['call' => [['determineRunMode $a = \Friendica\App::fromDice($dice); +$a->load( + $dice->create(\Friendica\Database\Definition\DbaDefinition::class), + $dice->create(\Friendica\Database\Definition\ViewDefinition::class), +); + \Friendica\DI::mode()->setExecutor(\Friendica\App\Mode::INDEX); $a->runFrontend( diff --git a/src/App.php b/src/App.php index d0881c5e55..479abe7c89 100644 --- a/src/App.php +++ b/src/App.php @@ -66,8 +66,6 @@ class App $dice->create(L10n::class), $dice->create(Arguments::class), $dice->create(IHandleUserSessions::class), - $dice->create(DbaDefinition::class), - $dice->create(ViewDefinition::class), $dice->create(AppHelper::class) ); } @@ -140,8 +138,6 @@ class App L10n $l10n, Arguments $args, IHandleUserSessions $session, - DbaDefinition $dbaDefinition, - ViewDefinition $viewDefinition, AppHelper $appHelper, ) { $this->container = $container; @@ -156,14 +152,12 @@ class App $this->args = $args; $this->session = $session; $this->appHelper = $appHelper; - - $this->load($dbaDefinition, $viewDefinition); } /** * Load the whole app instance */ - protected function load(DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition) + public function load(DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition) { if ($this->config->get('system', 'ini_max_execution_time') !== false) { set_time_limit((int)$this->config->get('system', 'ini_max_execution_time')); diff --git a/tests/Unit/AppTest.php b/tests/Unit/AppTest.php index c7b9599627..a0b0270e39 100644 --- a/tests/Unit/AppTest.php +++ b/tests/Unit/AppTest.php @@ -18,7 +18,7 @@ class AppTest extends TestCase public function testFromDiceReturnsApp(): void { $dice = $this->createMock(Dice::class); - $dice->expects($this->exactly(13))->method('create')->willReturnCallback(function($classname) { + $dice->expects($this->exactly(11))->method('create')->willReturnCallback(function($classname) { return $this->createMock($classname); });