DecimalIsLessThanTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 17
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGreater() 0 4 1
A testEqual() 0 4 1
A testLess() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
use Litipk\BigNumbers\Decimal;
5
use PHPUnit\Framework\TestCase;
6
7
class DecimalIsLessThanTest extends TestCase
8
{
9
    public function testGreater()
10
    {
11
        $this->assertFalse(Decimal::fromFloat(1.01)->isLessThan(Decimal::fromFloat(1.001)));
12
    }
13
14
    public function testEqual()
15
    {
16
        $this->assertFalse(Decimal::fromFloat(1.001)->isLessThan(Decimal::fromFloat(1.001)));
17
    }
18
19
    public function testLess()
20
    {
21
        $this->assertTrue(Decimal::fromFloat(1.001)->isLessThan(Decimal::fromFloat(1.01)));
22
    }
23
}
24