toBeInstanceOf(MoneyAmount::class) ->and($amount->value)->toBe($money); }); it('implements equals by delegating to the wrapped Money', function (): void { // GIVEN $amount1 = new MoneyAmount(new Money(Currency::EUR, 300)); $amount2 = new MoneyAmount(new Money(Currency::EUR, 300)); $amount3 = new MoneyAmount(new Money(Currency::EUR, 500)); // THEN expect($amount1->equals($amount2))->toBeTrue() ->and($amount1->equals($amount3))->toBeFalse() ->and($amount1->equals(null))->toBeFalse(); }); it('converts to string by delegating to the wrapped Money', function (): void { // GIVEN $amount = new MoneyAmount(new Money(Currency::EUR, 300)); // THEN expect((string) $amount)->toBe((string) $amount->value); }); });