From 7bdec85ca1854774e76d1a48e8d5c9572e325bd3 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Sun, 13 Mar 2022 16:52:27 +0400 Subject: [PATCH] Early declaration for TestableKernelInterface --- src/TestCase.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/TestCase.php b/src/TestCase.php index bb38463..b37cad2 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -101,22 +101,22 @@ protected function initApp(array $env = []): AbstractKernel { $environment = new Environment($env); - $app = $this->createAppInstance(); - $app->getContainer()->bindSingleton(EnvironmentInterface::class, $environment); + $this->app = $this->createAppInstance(); + $this->app->getContainer()->bindSingleton(EnvironmentInterface::class, $environment); foreach ($this->beforeBooting as $callback) { - $app->getContainer()->invoke($callback); + $this->app->getContainer()->invoke($callback); } - $app->starting(...$this->beforeStarting); - $app->run($environment); + $this->app->starting(...$this->beforeStarting); + $this->app->run($environment); - return $app; + return $this->app; } protected function refreshApp() { - $this->app = $this->initApp(static::ENV); + $this->initApp(static::ENV); } /**