Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function testAsInteger() |
||
13 | { |
||
14 | $this->assertEquals(1, Decimal::fromString('1.0')->asInteger()); |
||
15 | $this->assertTrue(is_int(Decimal::fromString('1.0')->asInteger())); |
||
16 | |||
17 | $this->assertEquals(1, Decimal::fromInteger(1)->asInteger()); |
||
18 | $this->assertTrue(is_int(Decimal::fromInteger(1)->asInteger())); |
||
19 | |||
20 | $this->assertEquals(1, Decimal::fromFloat(1.0)->asInteger()); |
||
21 | $this->assertEquals(1, Decimal::fromString('1.123123123')->asInteger()); |
||
22 | |||
23 | $this->assertTrue(is_int(Decimal::fromFloat(1.0)->asInteger())); |
||
24 | $this->assertTrue(is_int(Decimal::fromString('1.123123123')->asInteger())); |
||
25 | } |
||
26 | |||
42 |