admin = UserFactory::asAdmin()->withTokens()->create(); ScreenshotFactory::fake()->withRandomRelations()->createMany(self::SCREENSHOTS_AMOUNT); } public function test_list(): void { $response = $this->actingAs($this->admin)->postJson(self::URI); $response->assertOk(); $response->assertJson(Screenshot::all()->toArray()); } public function test_unauthorized(): void { $response = $this->getJson(self::URI); $response->assertUnauthorized(); } }