email = new Email('customer@example.com'); $customer->hashcode = new CrmHashcode(UuidHelper::v4()); $customer->last_login_at = null; $customer->saveOrFail(); $action = new UpdateCustomerLastLogin(); $input = new UpdateCustomerLastLoginInput($customer); // WHEN $updated = $action($input); // THEN expect($updated->last_login_at?->format('Y-m-d H:i:s'))->toBe('2026-11-14 10:30:00') ->and(Customer::query()->find($customer->id)?->last_login_at?->format('Y-m-d H:i:s')) ->toBe('2026-11-14 10:30:00'); Date::setTestNow(); }); it('throws when an invalid input is passed', function (): void { // GIVEN $action = new UpdateCustomerLastLogin(); $invalidInput = new class () implements ActionInput { }; // WHEN expect( /** @phpstan-ignore argument.type */ fn () => $action($invalidInput) ) // THEN ->toThrow(\InvalidArgumentException::class); }); });