DebitCreditTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testDebitCredit() 0 11 1
A statementProvider() 0 11 1
1
<?php
2
3
namespace Kingsquare\Parser\Banking\Mt940\Engine;
4
5
/**
6
 *
7
 */
8
class DebitCreditTest extends \PHPUnit_Framework_TestCase
9
{
10
    /**
11
     * @dataProvider statementProvider
12
     *
13
     * @param string $dOrC      D|C
14
     * @param string $statement
15
     */
16
    public function testDebitCredit($dOrC, $statement)
17
    {
18
        $engine = new Unknown();
19
        $property = new \ReflectionProperty($engine, 'currentTransactionData');
20
        $property->setAccessible(true);
21
22
        $method = new \ReflectionMethod($engine, 'parseTransactionDebitCredit');
23
        $method->setAccessible(true);
24
25
        $property->setValue($engine, $statement);
26
        $this->assertEquals($dOrC, $method->invoke($engine));
27
    }
28
29
    /**
30
     * @return array
31
     */
32
    public function statementProvider()
33
    {
34
        return [
35
                ['D', ':61:030111D000000000500.00NMSC1173113681      ROBECO'],
36
                ['C', ':61:100628C49,37NOV NONREF'],
37
                ['D', ':61:100628D49,37this is a Testds'],
38
                ['C', ':61:100628C49,37D is actually a'],
39
                ['C', ':61:100628C36,07NVZ NONREF'],
40
                ['C', ':61:1004080408C23,7N196NONREF'],
41
                ['D', ':61:030109D000000000110.00NMSC644530030       INSTANT-LOTERY, STG.NAT'],
42
                ['D', ':61:1004160416D1133,57N422NONREF'],
43
        ];
44
    }
45
}
46