From f0ff8248e7d5dc70a47d88e3bf39afd8fdfe1f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 22 May 2020 20:08:50 +0200 Subject: [PATCH] Clean up global state in tests --- tests/RequestDataIdentificationTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/RequestDataIdentificationTest.php b/tests/RequestDataIdentificationTest.php index 1f3cc459..52a502f9 100644 --- a/tests/RequestDataIdentificationTest.php +++ b/tests/RequestDataIdentificationTest.php @@ -20,14 +20,19 @@ class RequestDataIdentificationTest extends TestCase ], ]); - InitializeTenancyByRequestData::$header = 'X-Tenant'; - InitializeTenancyByRequestData::$queryParameter = 'tenant'; - Route::middleware(InitializeTenancyByRequestData::class)->get('/test', function () { return 'Tenant id: ' . tenant('id'); }); } + public function tearDown(): void + { + InitializeTenancyByRequestData::$header = 'X-Tenant'; + InitializeTenancyByRequestData::$queryParameter = 'tenant'; + + parent::tearDown(); + } + /** @test */ public function header_identification_works() {