| Conditions | 3 |
| Paths | 4 |
| Total Lines | 24 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 33 | public function testInfiniteInfiniteAdd() |
||
| 34 | { |
||
| 35 | $pInf = InfiniteDecimal::getPositiveInfinite(); |
||
| 36 | $nInf = InfiniteDecimal::getNegativeInfinite(); |
||
| 37 | |||
| 38 | $this->assertTrue($pInf->add($pInf)->equals($pInf)); |
||
| 39 | $this->assertTrue($nInf->add($nInf)->equals($nInf)); |
||
| 40 | |||
| 41 | $catched = false; |
||
| 42 | try { |
||
| 43 | $pInf->add($nInf); |
||
| 44 | } catch (\DomainException $e) { |
||
| 45 | $catched = true; |
||
| 46 | } |
||
| 47 | $this->assertTrue($catched); |
||
| 48 | |||
| 49 | $catched = false; |
||
| 50 | try { |
||
| 51 | $nInf->add($pInf); |
||
| 52 | } catch (\DomainException $e) { |
||
| 53 | $catched = true; |
||
| 54 | } |
||
| 55 | $this->assertTrue($catched); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |