value)->toBe(60) ->and($rate->toInt())->toBe(60) ->and((string) $rate)->toBe('60'); }); it('rejects values less than 1', function (int $invalid): void { // GIVEN & WHEN & THEN expect(fn () => new RequestsPerMinute($invalid)) ->toThrow(\InvalidArgumentException::class); })->with([0, -1, -100]); it('compares with another RequestsPerMinute instance', function (): void { // GIVEN $rate60 = new RequestsPerMinute(60); $rate120 = new RequestsPerMinute(120); // THEN expect($rate120->isGreaterThan($rate60))->toBeTrue() ->and($rate60->isGreaterThan($rate120))->toBeFalse() ->and($rate60->equals(new RequestsPerMinute(60)))->toBeTrue() ->and($rate60->equals($rate120))->toBeFalse(); }); });