DecimalFromDecimalTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBasicCase() 0 10 1
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 DecimalFromDecimalTest extends TestCase
9
{
10
    public function testBasicCase()
11
    {
12
        $n1 = Decimal::fromString('3.45');
13
14
        $this->assertTrue(Decimal::fromDecimal($n1)->equals($n1));
15
        $this->assertTrue(Decimal::fromDecimal($n1, 2)->equals($n1));
16
17
        $this->assertTrue(Decimal::fromDecimal($n1, 1)->equals(Decimal::fromString('3.5')));
18
        $this->assertTrue(Decimal::fromDecimal($n1, 0)->equals(Decimal::fromString('3')));
19
    }
20
}
21