Completed
Push — master ( 26e69a...ab0b77 )
by Robin
03:27
created

ParseTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 3
Bugs 0 Features 1
Metric Value
wmc 3
c 3
b 0
f 1
lcom 1
cbo 3
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testParseStatementBank() 0 6 1
A testParsesAllFoundStatements() 0 11 1
1
<?php
2
3
namespace Kingsquare\Parser\Banking\Mt940\Engine\Ing;
4
5
use Kingsquare\Parser\Banking\Mt940\Engine\Ing;
6
7
/**
8
 *
9
 */
10
class ParseTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * @var Ing
14
     */
15
    private $engine = null;
16
17
    protected function setUp()
18
    {
19
        $this->engine = new Ing();
20
        $this->engine->loadString(file_get_contents(__DIR__.'/sample'));
21
    }
22
23
    /**
24
     *
25
     */
26
    public function testParseStatementBank()
27
    {
28
        $method = new \ReflectionMethod($this->engine, 'parseStatementBank');
29
        $method->setAccessible(true);
30
        $this->assertEquals('ING', $method->invoke($this->engine));
31
    }
32
33
    public function testParsesAllFoundStatements()
34
    {
35
        $statements = $this->engine->parse();
36
37
        $this->assertEquals(1, count($statements));
38
        $first = $statements[0];
39
40
        $this->assertEquals('22-07-2010', $first->getStartTimestamp('d-m-Y'));
41
        $this->assertEquals('23-07-2010', $first->getEndTimestamp('d-m-Y'));
42
        $this->assertEquals(-3.47, $first->getDeltaPrice());
43
    }
44
}
45