DecimalAbsTest::testAbs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
use Litipk\BigNumbers\Decimal as Decimal;
4
use PHPUnit\Framework\TestCase;
5
6
date_default_timezone_set('UTC');
7
8
class DecimalAbsTest extends TestCase
9
{
10
    public function testAbs()
11
    {
12
        $this->assertTrue(Decimal::fromInteger(0)->abs()->equals(Decimal::fromInteger(0)));
13
        $this->assertTrue(Decimal::fromInteger(5)->abs()->equals(Decimal::fromInteger(5)));
14
        $this->assertTrue(Decimal::fromInteger(-5)->abs()->equals(Decimal::fromInteger(5)));
15
    }
16
}
17