Esempio n. 1
0
 public function testCanBeNegated()
 {
     $a = new Money(1);
     // Act
     $b = $a->negate();
     // Assert
     $this->assertEquals(-1, $b->getAmount());
 }
Esempio n. 2
0
 public function testCanBeNegative()
 {
     // arrange
     $a = new Money(1);
     // act
     $b = $a->negate();
     // assert
     $this->assertEquals(-1, $b->getAmount());
 }
Esempio n. 3
0
 /**
  * @covers \SebastianBergmann\Money\Money::negate
  * @covers \SebastianBergmann\Money\Money::newMoney
  * @uses   \SebastianBergmann\Money\Money::__construct
  * @uses   \SebastianBergmann\Money\Money::handleCurrencyArgument
  * @uses   \SebastianBergmann\Money\Money::getAmount
  * @uses   \SebastianBergmann\Money\Currency
  */
 public function testCanBeNegated()
 {
     $a = new Money(1, new Currency('EUR'));
     $b = $a->negate();
     $this->assertEquals(1, $a->getAmount());
     $this->assertEquals(-1, $b->getAmount());
 }
Esempio n. 4
0
 public function testCanBeNegated()
 {
     $money2 = new Money(1);
     $badMoney = $money2->negate();
     $this->assertEquals(-1, $badMoney->getAmount());
 }