Some code optimisations.

This commit is contained in:
James Cole
2019-04-09 15:42:25 +02:00
parent 97726c3822
commit 80896b7181
37 changed files with 153 additions and 129 deletions

View File

@@ -27,8 +27,9 @@ namespace Tests\Unit\Support\Import\Placeholder;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\Import\Placeholder\ColumnValue;
use FireflyIII\Support\Import\Placeholder\ImportTransaction;
use Tests\TestCase;
use Log;
use Tests\TestCase;
/**
* Class ImportTransactionTest
*/
@@ -474,38 +475,6 @@ class ImportTransactionTest extends TestCase
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountNegatedPositive(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountNegated = '1.56';
try {
$this->assertEquals('-1.56', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountNegatedNegative(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountNegated = '-1.56';
try {
$this->assertEquals('1.56', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* With no amount data, object should return ''
@@ -539,6 +508,38 @@ class ImportTransactionTest extends TestCase
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountNegatedNegative(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountNegated = '-1.56';
try {
$this->assertEquals('1.56', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info. Should return something like '1.0'.
*
* @covers \FireflyIII\Support\Import\Placeholder\ImportTransaction
*/
public function testCalculateAmountNegatedPositive(): void
{
$importTransaction = new ImportTransaction;
$importTransaction->amountNegated = '1.56';
try {
$this->assertEquals('-1.56', $importTransaction->calculateAmount());
} catch (FireflyException $e) {
$this->assertTrue(false, $e->getMessage());
}
}
/**
* Basic amount info with positive modifier (Rabobank C)
*