mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Some code optimisations.
This commit is contained in:
@@ -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)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user