test_that_no_division_by_zero_is_performed_without_explicit_scale()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
use Litipk\BigNumbers\Decimal;
6
use PHPUnit\Framework\TestCase;
7
8
class issue53Test extends TestCase
9
{
10
    public function test_that_no_division_by_zero_is_performed_without_explicit_scale()
11
    {
12
        $d1 = Decimal::create(192078120.5);
13
        $d2 = Decimal::create(31449600);
14
15
        $d1->div($d2);
16
17
        // We are asserting that no exception is thrown
18
        $this->assertTrue(true);
19
    }
20
21
    public function test_that_no_division_by_zero_is_performed_with_explicit_scale()
22
    {
23
        $d1 = Decimal::create(192078120.5, 28);
24
        $d2 = Decimal::create(31449600, 28);
25
26
        $d1->div($d2);
27
28
        // We are asserting that no exception is thrown
29
        $this->assertTrue(true);
30
    }
31
}
32