routeBase = "{$route_prefix}media"; } public function testCanGetIndex(): void { Recipe::factory()->createOneWithMedia(); $index_route = route("$this->routeBase.index"); $response = $this->get($index_route); $response->assertOk(); $response->assertJsonCount(1, 'data'); } public function testCanGetRelatedOwner(): void { $record = Recipe::factory()->createOneWithMedia(); $this->getRelatedData($record->media->first(), 'owner', 'recipes'); } public function testCanIncludeRelatedOwner(): void { $record = Recipe::factory()->createOneWithMedia(); $this->getRelatedData($record->media->first(), 'owner', 'recipes'); } }