create([ 'status' => true, ]); $action = new ToggleModelStatus(); $input = new ToggleModelStatusInput($tag); // WHEN $result = $action($input); // THEN expect($result->getAttribute('status'))->toBeFalse(); $fresh = Tag::query()->find($tag->id); expect($fresh?->getAttribute('status'))->toBeFalse(); }); it('throws when an invalid input is passed', function (): void { // GIVEN $action = new ToggleModelStatus(); $invalidInput = new class () implements ActionInput { }; // WHEN expect( /** @phpstan-ignore argument.type */ fn () => $action($invalidInput) ) // THEN ->toThrow(\InvalidArgumentException::class); }); });