create(); $action = new DeletePickupException(); $input = new DeletePickupExceptionInput( pickupException: $pickupException, ); // WHEN $result = $action($input); // THEN expect($result)->toBeTrue(); expect(PickupException::query()->find($pickupException->id))->toBeNull(); }); test('it throws when an invalid input is passed', function () { // GIVEN $action = new DeletePickupException(); $invalidInput = new class () implements ActionInput { }; /** @var \Closure(\App\Contracts\ActionInput): mixed $callable */ $callable = \Closure::fromCallable($action); // WHEN & THEN expect(fn () => $callable($invalidInput))->toThrow(\InvalidArgumentException::class); }); });