Esempio n. 1
0
 public function testShouldBeImmutable()
 {
     $p1ArrayMoney = ['EUR' => 100, 'GBP' => 101];
     $p2ArrayMoney = ['EUR' => 100];
     $p2ArrayCurrency = ['EUR/GBP 1.100'];
     $price1 = new Price($p1ArrayMoney);
     $price2 = new Price($p2ArrayMoney, $p2ArrayCurrency);
     $priceAdd = $price1->add($price2);
     $priceMul = $price1->multiply(2);
     $this->assertEquals(new Price($p1ArrayMoney), $price1);
     $this->assertEquals(new Price($p2ArrayMoney, $p2ArrayCurrency), $price2);
 }