Completed
Push — master ( a8d4ee...1646cc )
by Robin
09:05
created

ParseTransactionPriceTest::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Kingsquare\Parser\Banking\Mt940\Engine;
4
5
/**
6
 *
7
 */
8
class ParseTransactionPriceTest extends \PHPUnit_Framework_TestCase
9
{
10
11
    /**
12
     * @dataProvider getTransactions
13
     */
14 View Code Duplication
    public function test($inputString, $expected) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
        $engine = new Unknown();
16
        $property = new \ReflectionProperty($engine, 'currentTransactionData');
17
        $property->setAccessible(true);
18
        $property->setValue($engine, $inputString);
19
20
        $method = new \ReflectionMethod($engine, 'parseTransactionPrice');
21
        $method->setAccessible(true);
22
        $this->assertSame($expected, $method->invoke($engine));
23
    }
24
25
    public function getTransactions()
26
    {
27
        return [
28
          'sample-ABN' => [':61:0906240625D1027,91N422NONREF', 1027.91],
29
          'sample-Ing' => [':61:100722C25,03NOV NONREF', 25.03],
30
          'sample-Rabo' => [':61:030111D000000000500.00NMSC1173113681      ROBECO', 500.00],
31
          'sample-Spk' => [':61:1002170217C10,N0520000000000000002', 10.00],
32
          'sample-Tri' => [':61:1002170217C10,N0520000000000000002', 10.00],
33
          'sample-Unknown' => [':61:1002170217C10,N0520000000000000002', 10.00],
34
          'issue-53-withMultiple-CD-chars' => [':61:1807300730D28,5N132000002018827922//B8G30PGA01UD901N', 28.50],
35
        ];
36
    }
37
}