mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 15:18:05 +00:00
Improve test coverage.
This commit is contained in:
@@ -45,9 +45,6 @@ class SetDestinationAccountTest extends TestCase
|
||||
*/
|
||||
public function testActDepositExisting(): void
|
||||
{
|
||||
$this->markTestIncomplete('Needs to be rewritten for v4.8.0');
|
||||
|
||||
return;
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$deposit = $this->getRandomDeposit();
|
||||
$destinationTr = $deposit->transactions()->where('amount', '>', 0)->first();
|
||||
@@ -82,9 +79,6 @@ class SetDestinationAccountTest extends TestCase
|
||||
*/
|
||||
public function testActDepositNotExisting(): void
|
||||
{
|
||||
$this->markTestIncomplete('Needs to be rewritten for v4.8.0');
|
||||
|
||||
return;
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$deposit = $this->getRandomDeposit();
|
||||
|
||||
@@ -107,11 +101,8 @@ class SetDestinationAccountTest extends TestCase
|
||||
*/
|
||||
public function testActWithDrawalNotExisting(): void
|
||||
{
|
||||
$this->markTestIncomplete('Needs to be rewritten for v4.8.0');
|
||||
|
||||
return;
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$account = $this->user()->accounts()->inRandomOrder()->where('account_type_id', 4)->first();
|
||||
$account = $this->getRandomExpense();
|
||||
$withdrawal = $this->getRandomWithdrawal();
|
||||
|
||||
// find account? Return account:
|
||||
@@ -135,9 +126,6 @@ class SetDestinationAccountTest extends TestCase
|
||||
*/
|
||||
public function testActWithdrawalExisting(): void
|
||||
{
|
||||
$this->markTestIncomplete('Needs to be rewritten for v4.8.0');
|
||||
|
||||
return;
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$withdrawal = $this->getRandomWithdrawal();
|
||||
$destinationTr = $withdrawal->transactions()->where('amount', '>', 0)->first();
|
||||
@@ -165,30 +153,4 @@ class SetDestinationAccountTest extends TestCase
|
||||
$this->assertEquals($newDestination->id, $account->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test this on a split journal.
|
||||
*
|
||||
* @covers \FireflyIII\TransactionRules\Actions\SetDestinationAccount
|
||||
*/
|
||||
public function testSplitJournal(): void
|
||||
{
|
||||
$this->markTestIncomplete('Needs to be rewritten for v4.8.0');
|
||||
|
||||
return;
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$transaction = Transaction::orderBy('count', 'DESC')->groupBy('transaction_journal_id')
|
||||
->get(['transaction_journal_id', DB::raw('COUNT(transaction_journal_id) as count')])
|
||||
->first();
|
||||
$journal = TransactionJournal::find($transaction->transaction_journal_id);
|
||||
|
||||
// mock
|
||||
$accountRepos->shouldReceive('setUser');
|
||||
|
||||
// fire the action:
|
||||
$ruleAction = new RuleAction;
|
||||
$ruleAction->action_value = 'Some new asset ' . $this->randomInt();
|
||||
$action = new SetDestinationAccount($ruleAction);
|
||||
$result = $action->act($journal);
|
||||
$this->assertFalse($result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user