public function testCorrectHandlingOfVariousStatementPricing() { $this->engine->loadString(file_get_contents(__DIR__ . '/sample2')); $statements = $this->engine->parse(); $this->assertEquals(-1000.12, $statements[0]->getStartPrice()); $this->assertEquals(2145.23, $statements[0]->getEndPrice()); $this->assertEquals(-3145.35, $statements[0]->getDeltaPrice()); }
public function testHandlingOfDescriptions() { $this->engine->loadString(file_get_contents(__DIR__ . '/sample')); $statements = $this->engine->parse(); $this->assertSame('Contante storting Overige', $statements[4]->getTransactions()[1]->getDescription()); $this->assertSame('INVOICE 38', $statements[14]->getTransactions()[3]->getDescription()); $this->assertSame('VOLGENS AFSPRAAK', $statements[15]->getTransactions()[0]->getDescription()); $this->assertSame('FAKTUUR 3549', $statements[15]->getTransactions()[1]->getDescription()); $this->engine->loadString(file_get_contents(__DIR__ . '/sample3')); $statements = $this->engine->parse(); // enclosed $this->assertSame('674725433 1120000153447185 14144467636004962', $statements[0]->getTransactions()[0]->getDescription()); // ending $this->assertSame('861835-574631143', $statements[0]->getTransactions()[2]->getDescription()); // with slash $this->assertSame('/IBS.00008908/ 1001680-P796142 KINDEROPVANG', $statements[0]->getTransactions()[3]->getDescription()); $this->assertSame('Factuur 307472', $statements[1]->getTransactions()[0]->getDescription()); $this->engine->loadString(<<<PURPTEST :940: :20:940S130403 :25:NL50RABO0123456789 :28C:0 :60F:C130402EUR000000001147,95 :20:940S160503 :25:NL93RABO0157787990 EUR :28C:16085 :60F:C160502EUR000000146645,88 :61:160503D000000000015,55N102EREF NL34DEUT0499438906 :86:/EREF/02-06-2016 09:00 1230000456789011/BENM//NAME/Some Name d company/REMI/some descripton here that ends with/PURP//CD/EPAY :62F:C160503EUR000000146630,33 PURPTEST ); $statements = $this->engine->parse(); $this->assertSame('some descripton here thatends with', $statements[1]->getTransactions()[0]->getDescription()); }
public function testInitialNegativeStatementBalance() { $this->engine->loadString(file_get_contents(__DIR__ . '/sample2')); $statements = $this->engine->parse(); $this->assertEquals(-1000.12, $statements[0]->getStartPrice()); }