Experimental fix for #2031

This commit is contained in:
James Cole
2019-01-27 21:23:18 +01:00
parent 968505ac0e
commit d905849b71
6 changed files with 98 additions and 218 deletions

View File

@@ -23,14 +23,16 @@ declare(strict_types=1);
namespace Tests\Unit\Import\Converter;
use FireflyIII\Import\Converter\BankDebitCredit;
use FireflyIII\Import\Converter\INGDebitCredit;
use Log;
use Tests\TestCase;
/**
* Class INGDebitCreditTest
*
* Class BankDebitCreditTest
*/
class INGDebitCreditTest extends TestCase
class BankDebitCreditTest extends TestCase
{
/**
*
@@ -41,34 +43,53 @@ class INGDebitCreditTest extends TestCase
Log::info(sprintf('Now in %s.', \get_class($this)));
}
/**
* @covers \FireflyIII\Import\Converter\BankDebitCredit
*/
public function testConvertA(): void
{
$converter = new BankDebitCredit;
$result = $converter->convert('A');
$this->assertEquals(-1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit
* @covers \FireflyIII\Import\Converter\BankDebitCredit
*/
public function testConvertAf(): void
{
$converter = new INGDebitCredit;
$converter = new BankDebitCredit;
$result = $converter->convert('Af');
$this->assertEquals(-1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit
* @covers \FireflyIII\Import\Converter\BankDebitCredit
*/
public function testConvertAnything(): void
{
$converter = new INGDebitCredit;
$converter = new BankDebitCredit;
$result = $converter->convert('9083jkdkj');
$this->assertEquals(1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\INGDebitCredit
* @covers \FireflyIII\Import\Converter\BankDebitCredit
*/
public function testConvertBij(): void
{
$converter = new INGDebitCredit;
$converter = new BankDebitCredit;
$result = $converter->convert('Bij');
$this->assertEquals(1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\BankDebitCredit
*/
public function testConvertDebet(): void
{
$converter = new BankDebitCredit;
$result = $converter->convert('Debet');
$this->assertEquals(-1, $result);
}
}

View File

@@ -1,94 +0,0 @@
<?php
/**
* RabobankDebitCreditTest.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Unit\Import\Converter;
use FireflyIII\Import\Converter\RabobankDebitCredit;
use Log;
use Tests\TestCase;
/**
* Class RabobankDebitCredit
*/
class RabobankDebitCreditTest extends TestCase
{
/**
*
*/
public function setUp(): void
{
parent::setUp();
Log::info(sprintf('Now in %s.', \get_class($this)));
}
/**
* @covers \FireflyIII\Import\Converter\RabobankDebitCredit
*/
public function testConvertAnything(): void
{
$converter = new RabobankDebitCredit;
$result = $converter->convert('9083jkdkj');
$this->assertEquals(1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\RabobankDebitCredit
*/
public function testConvertCredit(): void
{
$converter = new RabobankDebitCredit;
$result = $converter->convert('C');
$this->assertEquals(1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\RabobankDebitCredit
*/
public function testConvertCreditOld(): void
{
$converter = new RabobankDebitCredit;
$result = $converter->convert('B');
$this->assertEquals(1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\RabobankDebitCredit
*/
public function testConvertDebit(): void
{
$converter = new RabobankDebitCredit;
$result = $converter->convert('D');
$this->assertEquals(-1, $result);
}
/**
* @covers \FireflyIII\Import\Converter\RabobankDebitCredit
*/
public function testConvertDebitOld(): void
{
$converter = new RabobankDebitCredit;
$result = $converter->convert('A');
$this->assertEquals(-1, $result);
}
}