admin = UserFactory::asAdmin()->withTokens()->create(); ScreenshotFactory::fake()->createMany(self::SCREENSHOTS_AMOUNT); } public function test_count(): void { $response = $this->actingAs($this->admin)->getJson(self::URI); $response->assertOk(); $response->assertJson(['total' => Screenshot::count()]); } public function test_unauthorized(): void { $response = $this->getJson(self::URI); $response->assertUnauthorized(); } }