routePrefix = config('json-api-v1.url.name'); } /** * Create instances of the model being tested. */ protected function createInstances(int $count = 1): Collection { return $this->factory()->count($count)->create(); } public function testCanGetIndex(): void { $this->createInstances(10); $index_url = route("{$this->routePrefix}{$this->resourceName()}.index"); $response = $this->get($index_url); $response->assertOk(); $response->assertJson(['data' => true]); $response->assertJsonCount(10, 'data'); } }