diff --git a/tests/RoadRunnerServerProcessInspectorTest.php b/tests/RoadRunnerServerProcessInspectorTest.php index f10583706..7d92095bb 100644 --- a/tests/RoadRunnerServerProcessInspectorTest.php +++ b/tests/RoadRunnerServerProcessInspectorTest.php @@ -50,6 +50,7 @@ public function test_can_determine_if_roadrunner_server_process_is_running_when_ /** @doesNotPerformAssertions @test */ public function test_roadrunner_server_process_can_be_reloaded() { + $this->createApplication(); $inspector = new ServerProcessInspector( $processIdFile = new ServerStateFile(sys_get_temp_dir().'/swoole.pid'), $processFactory = Mockery::mock(SymfonyProcessFactory::class), diff --git a/tests/SequentialTaskDispatcherTest.php b/tests/SequentialTaskDispatcherTest.php index 1454c71f5..c018b72c9 100644 --- a/tests/SequentialTaskDispatcherTest.php +++ b/tests/SequentialTaskDispatcherTest.php @@ -27,6 +27,7 @@ public function test_tasks_can_be_resolved() public function test_resolving_tasks_with_exceptions_do_not_effect_other_tasks() { + $this->createApplication(); $dispatcher = new SequentialTaskDispatcher; $a = false; @@ -77,6 +78,7 @@ public function test_tasks_can_be_dispatched() public function test_resolving_tasks_propagate_exceptions() { + $this->createApplication(); $dispatcher = new SequentialTaskDispatcher(); $this->expectException(TaskException::class); @@ -89,6 +91,7 @@ public function test_resolving_tasks_propagate_exceptions() public function test_resolving_tasks_propagate_dd_calls() { + $this->createApplication(); $dispatcher = new SequentialTaskDispatcher(); $this->expectException(DdException::class); diff --git a/tests/SwooleClientTest.php b/tests/SwooleClientTest.php index 017075286..00ce72da4 100644 --- a/tests/SwooleClientTest.php +++ b/tests/SwooleClientTest.php @@ -124,6 +124,7 @@ public function test_static_file_can_be_served(): void /** @doesNotPerformAssertions @test */ public function test_static_file_headers_can_be_sent(): void { + $this->createApplication(); $client = new SwooleClient; $request = Request::create('/foo.txt', 'GET'); @@ -206,6 +207,7 @@ public function test_respond_method_sends_response_to_swoole(): void /** @doesNotPerformAssertions @test */ public function test_respond_method_send_streamed_response_to_swoole(): void { + $this->createApplication(); $client = new SwooleClient; $swooleResponse = Mockery::mock('Swoole\Http\Response'); @@ -227,6 +229,7 @@ public function test_respond_method_send_streamed_response_to_swoole(): void /** @doesNotPerformAssertions @test */ public function test_respond_method_with_laravel_specific_status_code_sends_response_to_swoole(): void { + $this->createApplication(); $client = new SwooleClient; $swooleResponse = Mockery::mock('Swoole\Http\Response'); @@ -286,6 +289,7 @@ public function test_error_method_sends_detailed_error_response_to_swoole_in_deb /** @doesNotPerformAssertions @test */ public function test_respond_method_send_not_chunked_response_to_swoole(): void { + $this->createApplication(); $client = new SwooleClient; $swooleResponse = Mockery::mock(SwooleResponse::class); @@ -307,6 +311,7 @@ public function test_respond_method_send_not_chunked_response_to_swoole(): void /** @doesNotPerformAssertions @test */ public function test_respond_method_send_chunked_response_to_swoole(): void { + $this->createApplication(); $client = new SwooleClient(6); $swooleResponse = Mockery::mock('Swoole\Http\Response'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 6300e923f..a919710e2 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,6 +3,8 @@ namespace Laravel\Octane\Tests; use Carbon\Laravel\ServiceProvider as CarbonServiceProvider; +use Illuminate\Container\Container; +use Illuminate\Support\Facades\Facade; use Laravel\Octane\ApplicationFactory; use Laravel\Octane\Contracts\Client; use Laravel\Octane\Octane; @@ -72,6 +74,11 @@ protected function tearDown(): void { parent::tearDown(); + Container::setInstance(null); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication(null); + Mockery::close(); } }