Passed
Push — master ( 460ec1...4bf46c )
by Gabriel
07:02
created

FeeCalculatorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A data_netToGross() 0 5 1
A test_netToGross() 0 4 1
1
<?php
2
3
namespace ByTIC\Payments\Tests\Utility;
4
5
use ByTIC\Payments\Tests\AbstractTest;
6
use ByTIC\Payments\Utility\FeeCalculator;
7
8
/**
9
 * Class FeeCalculatorTest
10
 * @package ByTIC\Payments\Tests\Utility
11
 */
12
class FeeCalculatorTest extends AbstractTest
13
{
14
    /**
15
     * @dataProvider data_netToGross
16
     */
17
    public function test_netToGross($net, $gross, $percentage, $fixed)
18
    {
19
        $diff = abs($gross - FeeCalculator::netToGross($net, $percentage, $fixed));
20
        self::assertLessThan(1, $diff);
21
    }
22
23
    public function data_netToGross()
24
    {
25
        return [
26
            [29.4, 30, 0.99, 0.3],
27
            [148.21, 150,00, 0.99, 0.3],
28
        ];
29
    }
30
}