Beispiel #1
0
 public function testShouldFormatMoneyWithNewConfig()
 {
     $money = new Money(1000.99);
     $config = new MoneyConfig();
     $config->setDecimalPoint(',');
     $config->setThousandsSeparator('.');
     $config->setMoneySimbol('R$');
     $money->setConfig($config);
     $expected = 'R$ 1.000,99';
     $result = "{$money}";
     $this->assertEquals($expected, $result);
 }
 /**
  * @expectedException InvalidArgumentException
  */
 public function testShouldSetInvalidThousandsSeparator()
 {
     $config = new MoneyConfig();
     $config->setThousandsSeparator(array(1));
 }