Code cleanup and realign.

This commit is contained in:
James Cole
2018-08-06 19:14:30 +02:00
parent f7eef25fed
commit 5908c0ce8c
188 changed files with 1019 additions and 1031 deletions

View File

@@ -32,6 +32,52 @@ use Tests\TestCase;
*/
class IngDescriptionTest extends TestCase
{
/**
* Test changes to BA row.
*
* Remove specific fields.
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunBABasic(): void
{
$row = [0, 'XX', 2, '', 'BA', 5, 6, 7, 'XX', 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('XX XX', $result[8]);
}
/**
* Empty description? Use "tegenrekening".
* Remove specific fields.
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunEmptyDescr(): void
{
$row = [0, 1, 2, '', 'GT', 5, 6, 7, 'Naar Oranje Spaarrekening Bla bla', 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('Bla bla', $result[3]);
}
/**
* See if the description is removed
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunGTRemoveDescr(): void
{
$iban = 'NL66INGB0665877351';
$row = [0, 1, 2, $iban, 'GT', 5, 6, 7, 'Bla bla bla Omschrijving: Should be removed IBAN: ' . $iban, 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('Should be removed', $result[8]);
}
/**
* Try if the IBAN is removed in GT transactions
*
@@ -47,21 +93,6 @@ class IngDescriptionTest extends TestCase
$this->assertEquals('Should be removed', $result[8]);
}
/**
* Try if the IBAN is removed in OV transactions
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunOVRemoveIban(): void
{
$iban = 'NL66INGB0665877351';
$row = [0, 1, 2, $iban, 'OV', 5, 6, 7, 'Should be removed IBAN: ' . $iban, 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('Should be removed', $result[8]);
}
/**
* Try if the IBAN is removed in IC transactions
*
@@ -78,44 +109,14 @@ class IngDescriptionTest extends TestCase
}
/**
* Empty description? Use "tegenrekening".
* Remove specific fields.
* Try if the IBAN is removed in OV transactions
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunEmptyDescr(): void
{
$row = [0, 1, 2, '', 'GT', 5, 6, 7, 'Naar Oranje Spaarrekening Bla bla', 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('Bla bla', $result[3]);
}
/**
* Test changes to BA row.
*
* Remove specific fields.
*
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunBABasic(): void
{
$row = [0, 'XX', 2, '', 'BA', 5, 6, 7, 'XX', 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);
$this->assertEquals('XX XX', $result[8]);
}
/**
* See if the description is removed
* @covers \FireflyIII\Import\Specifics\IngDescription
*/
public function testRunGTRemoveDescr(): void
public function testRunOVRemoveIban(): void
{
$iban = 'NL66INGB0665877351';
$row = [0, 1, 2, $iban, 'GT', 5, 6, 7, 'Bla bla bla Omschrijving: Should be removed IBAN: ' . $iban, 9, 10];
$row = [0, 1, 2, $iban, 'OV', 5, 6, 7, 'Should be removed IBAN: ' . $iban, 9, 10];
$parser = new IngDescription;
$result = $parser->run($row);