Completed
Push — master ( 21a74f...4ebb19 )
by Andreu
03:23
created

issue53Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_that_no_division_by_zero_is_performed_without_explicit_scale() 0 10 1
A test_that_no_division_by_zero_is_performed_with_explicit_scale() 0 10 1
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