Passed
Pull Request — master (#87)
by
unknown
08:41
created

ParseTest::testParseStatementBank()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Kingsquare\Parser\Banking\Mt940\Engine\Btrl;
4
5
use Kingsquare\Parser\Banking\Mt940\Engine\Btrl;
6
7
/**
8
 *
9
 */
10
class ParseTest extends \PHPUnit\Framework\TestCase
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
{
12
    /**
13
     * @var Btrl
14
     */
15
    private $engine;
16
17
    protected function setUp(): void
18
    {
19
        $this->engine = new Btrl();
20
        $this->engine->loadString(file_get_contents(__DIR__.'/sample'));
21
    }
22
23
    public function testParseStatementBank():void
24
    {
25
        $method = new \ReflectionMethod($this->engine, 'parseStatementBank');
26
        $method->setAccessible(true);
27
        $this->assertEquals('BTRL', $method->invoke($this->engine));
28
    }
29
30
	public function testParseTransactionPrice(): void 
31
	{
32
		$statements = $this->engine->parse();
33
		$this->assertCount(1, $statements);
34
        $transactions = $statements[0]->getTransactions();
35
		
36
		$this->assertEquals('980.42', $transactions[0]->getPrice());
37
	}
38
	
39
}
40