admin = UserFactory::asAdmin()->withTokens()->create(); $this->screenshot = ScreenshotFactory::fake()->create(); } public function test_remove(): void { $this->assertDatabaseHas('screenshots', $this->screenshot->toArray()); $response = $this->actingAs($this->admin)->postJson(self::URI, $this->screenshot->only('id')); $response->assertOk(); $this->assertSoftDeleted('screenshots', $this->screenshot->only('id')); } public function test_unauthorized(): void { $response = $this->postJson(self::URI); $response->assertUnauthorized(); } public function test_without_params(): void { $response = $this->actingAs($this->admin)->postJson(self::URI); $response->assertValidationError(); } }