ParseTransactionPriceTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTransactions() 0 5 1
A test() 0 9 1
1
<?php
2
3
namespace Kingsquare\Parser\Banking\Mt940\Engine\Spk;
4
5
use Kingsquare\Parser\Banking\Mt940\Engine\Spk;
6
7
/**
8
 *
9
 */
10
class ParseTransactionPriceTest extends \PHPUnit_Framework_TestCase
11
{
12
13
    /**
14
     * @dataProvider getTransactions
15
     *
16
     * @param string $inputString
17
     * @param float $expected
18
     * @throws \ReflectionException
19
     */
20
    public function test($inputString, $expected) {
21
        $engine = new Spk;
22
        $property = new \ReflectionProperty($engine, 'currentTransactionData');
23
        $property->setAccessible(true);
24
        $property->setValue($engine, $inputString);
25
26
        $method = new \ReflectionMethod($engine, 'parseTransactionPrice');
27
        $method->setAccessible(true);
28
        $this->assertSame($expected, $method->invoke($engine));
29
    }
30
31
    public function getTransactions()
32
    {
33
        return [
34
          [':61:1002170217C10,N0520000000000000002', 10.00],
35
          [':61:1002170217D16,68N0050000000000123122D123', 16.68],
36
        ];
37
    }
38
}