| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function testSignsMul() |
||
| 26 | { |
||
| 27 | $n1 = Decimal::fromInteger(1); |
||
| 28 | $n2 = Decimal::fromInteger(-1); |
||
| 29 | |||
| 30 | $n11 = $n1->mul($n1); |
||
| 31 | $n12 = $n1->mul($n2); |
||
| 32 | $n21 = $n2->mul($n1); |
||
| 33 | |||
| 34 | $this->assertTrue($n1->equals($n11)); |
||
| 35 | $this->assertTrue($n11->equals($n1)); |
||
| 36 | |||
| 37 | $this->assertTrue($n11->isPositive()); |
||
| 38 | $this->assertFalse($n11->isNegative()); |
||
| 39 | |||
| 40 | $this->assertTrue($n12->equals($n21)); |
||
| 41 | $this->assertTrue($n21->equals($n12)); |
||
| 42 | |||
| 43 | $this->assertTrue($n12->isNegative()); |
||
| 44 | $this->assertTrue($n21->isNegative()); |
||
| 45 | |||
| 46 | $this->assertFalse($n12->isPositive()); |
||
| 47 | $this->assertFalse($n21->isPositive()); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |