mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
@@ -382,6 +382,7 @@ class ImportTransactionTest extends TestCase
|
||||
'account-number' => 'accountNumber',
|
||||
'amount_debit' => 'amountDebit',
|
||||
'amount_credit' => 'amountCredit',
|
||||
'amount_negated' => 'amountNegated',
|
||||
'amount' => 'amount',
|
||||
'amount_foreign' => 'foreignAmount',
|
||||
'bill-name' => 'billName',
|
||||
@@ -473,6 +474,38 @@ 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 ''
|
||||
|
Reference in New Issue
Block a user