money = new Money(Currency::EUR, 300); $this->secondMoney = new Money(Currency::EUR, 500); }); it('wraps a Money value', function (): void { // GIVEN / WHEN $amount = new MoneyAmount( $this->money ); // THEN expect($amount)->toBeInstanceOf(MoneyAmount::class) ->and($amount->value)->toBe($this->money); }); it('implements equals by delegating to the wrapped Money', function (): void { // GIVEN / WHEN $amount1 = new MoneyAmount( $this->money ); $amount2 = new MoneyAmount( $this->money ); $amount3 = new MoneyAmount( $this->secondMoney ); // 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 / WHEN $amount = new MoneyAmount( $this->money ); // THEN expect((string) $amount)->toBe((string) $amount->value); }); });