Completed
Push — master ( 66f869...1d0a0c )
by Robin
10:14 queued 08:39
created

ParseTransactionPriceTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test() 0 10 1
A getTransactions() 0 7 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
    public function test($inputString, $expected) {
17
        $engine = new Spk;
18
        $property = new \ReflectionProperty($engine, 'currentTransactionData');
19
        $property->setAccessible(true);
20
        $property->setValue($engine, $inputString);
21
22
        $method = new \ReflectionMethod($engine, 'parseTransactionPrice');
23
        $method->setAccessible(true);
24
        $this->assertSame($expected, $method->invoke($engine));
25
    }
26
27
    public function getTransactions()
28
    {
29
        return [
30
          [':61:1002170217C10,N0520000000000000002', 10.00],
31
          [':61:1002170217D16,68N0050000000000123122D123', 16.68],
32
        ];
33
    }
34
}