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

FeeCalculatorTest::data_netToGross()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 5
rs 10
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
}