mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
use cases for rules tested.
This commit is contained in:
parent
dc77d8edda
commit
b33ca786ae
@ -102,6 +102,9 @@ class SetDestinationAccount implements ActionInterface
|
||||
// update destination transaction with new destination account:
|
||||
// get destination transaction:
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if(null === $transaction) {
|
||||
return true;
|
||||
}
|
||||
$transaction->account_id = $this->newDestinationAccount->id;
|
||||
$transaction->save();
|
||||
$journal->touch();
|
||||
@ -131,7 +134,7 @@ class SetDestinationAccount implements ActionInterface
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function findExpenseAccount()
|
||||
private function findExpenseAccount(): void
|
||||
{
|
||||
$account = $this->repository->findByName($this->action->action_value, [AccountType::EXPENSE]);
|
||||
if (null === $account) {
|
||||
|
@ -92,6 +92,20 @@ class TransactionCurrencyFactoryTest extends TestCase
|
||||
$this->assertEquals($currency->id, $result->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* submit ID = 1000
|
||||
*
|
||||
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
|
||||
*/
|
||||
public function testFindByBadID(): void
|
||||
{
|
||||
$currency = TransactionCurrency::inRandomOrder()->whereNull('deleted_at')->first();
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$result = $factory->find(1000, $currency->code);
|
||||
$this->assertEquals($currency->id, $result->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers \FireflyIII\Factory\TransactionCurrencyFactory
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user