MT940Test   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testParseDescriptionLines() 0 22 1
1
<?php
2
3
namespace Tests\Fhp\Parser;
4
5
use Fhp\Parser\MT940;
6
7
class MT940Test extends \PHPUnit_Framework_TestCase
8
{
9
	/**
10
	 * Parser must be able to parse description lines starting with "-".
11
	 */
12
	public function testParseDescriptionLines()
13
	{
14
		$rawData = [
15
			":20:STARTUMSE",
16
			":25:00000000/0221122370",
17
			":28C:00000/001",
18
			":60F:C170428EUR6670,54",
19
			":61:1705030503CR223,72N062NONREF",
20
			":86:166?00GUTSCHRIFT?109251?20EREF+CCB.122.UE.266455?21SVWZ+Re 17",
21
			"-H-0005 vom 24.04?22.2017?30DRESDEFF850?31DE00000000000000000000?",
22
			"32TEST TEST GBR",
23
			":62F:C170503EUR6894,26",
24
			"-"
25
		];
26
27
		$parser = new MT940(implode("\r\n", $rawData));
28
		$result = $parser->parse(MT940::TARGET_ARRAY);
29
		$this->assertEquals(
30
			'EREF+CCB.122.UE.266455SVWZ+Re 17-H-0005 vom 24.04.2017',
31
			$result['2017-04-28']['transactions'][0]['description']['description_1']
32
		);
33
	}
34
}
35