On page 79, the method that checks the equality of the current Money object with another one, is calling the equals method on its Currency VO, but passing the own Currency object instead the one from the Money object which is comparing with.
So from line 49:
public function equals(Money $aMoney) { return $this->amount() === $aMoney->amount() && $this->currency()->equals($this->currency()); }
Should be changed by:
public function equals(Money $aMoney) { return $this->amount() === $aMoney->amount() && $this->currency()->equals($aMoney->currency()); }
On page 79, the method that checks the equality of the current Money object with another one, is calling the equals method on its Currency VO, but passing the own Currency object instead the one from the Money object which is comparing with.
So from line 49:
public function equals(Money $aMoney) { return $this->amount() === $aMoney->amount() && $this->currency()->equals($this->currency()); }
Should be changed by:public function equals(Money $aMoney) { return $this->amount() === $aMoney->amount() && $this->currency()->equals($aMoney->currency()); }