From 0f6051bbe574c923be5953d1074d7d776f4e825b Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Wed, 7 Jun 2023 16:18:02 -0700 Subject: [PATCH] Inline method call --- .../Api/Components/ComponentIndexTest.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tests/Feature/Api/Components/ComponentIndexTest.php b/tests/Feature/Api/Components/ComponentIndexTest.php index 978d4be10b..845ce29b99 100644 --- a/tests/Feature/Api/Components/ComponentIndexTest.php +++ b/tests/Feature/Api/Components/ComponentIndexTest.php @@ -5,7 +5,6 @@ namespace Tests\Feature\Api\Components; use App\Models\Company; use App\Models\Component; use App\Models\User; -use Illuminate\Testing\TestResponse; use Laravel\Passport\Passport; use Tests\Support\InteractsWithResponses; use Tests\Support\InteractsWithSettings; @@ -30,40 +29,35 @@ class ComponentIndexTest extends TestCase $this->settings->disableMultipleFullCompanySupport(); Passport::actingAs($superUser); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseContainsInRows($response, $componentA); $this->assertResponseContainsInRows($response, $componentB); Passport::actingAs($userInCompanyA); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseContainsInRows($response, $componentA); $this->assertResponseContainsInRows($response, $componentB); Passport::actingAs($userInCompanyB); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseContainsInRows($response, $componentA); $this->assertResponseContainsInRows($response, $componentB); $this->settings->enableMultipleFullCompanySupport(); Passport::actingAs($superUser); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseContainsInRows($response, $componentA); $this->assertResponseContainsInRows($response, $componentB); Passport::actingAs($userInCompanyA); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseContainsInRows($response, $componentA); $this->assertResponseDoesNotContainInRows($response, $componentB); Passport::actingAs($userInCompanyB); - $response = $this->sendRequest(); + $response = $this->getJson(route('api.components.index')); $this->assertResponseDoesNotContainInRows($response, $componentA); $this->assertResponseContainsInRows($response, $componentB); } - - private function sendRequest(): TestResponse - { - return $this->getJson(route('api.components.index')); - } }