mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
Fix coverage.
This commit is contained in:
parent
9c5523252d
commit
b66daad3d3
@ -72,21 +72,22 @@ class PiggyBankEventFactoryTest extends TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for withdrawal where piggy has no repetition.
|
||||
*
|
||||
* @covers \FireflyIII\Factory\PiggyBankEventFactory
|
||||
*/
|
||||
public function testCreateNoRep()
|
||||
public function testCreateNoRep(): void
|
||||
{
|
||||
/** @var TransactionJournal $transfer */
|
||||
$transfer = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();
|
||||
$piggy = $this->user()->piggyBanks()->first();
|
||||
$repetition = new PiggyBankRepetition;
|
||||
$repos = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
$transfer = $this->user()->transactionJournals()->where('transaction_type_id', 3)->first();
|
||||
$piggy = $this->user()->piggyBanks()->first();
|
||||
$repos = $this->mock(PiggyBankRepositoryInterface::class);
|
||||
/** @var PiggyBankEventFactory $factory */
|
||||
$factory = app(PiggyBankEventFactory::class);
|
||||
|
||||
// mock:
|
||||
$repos->shouldReceive('setUser');
|
||||
$repos->shouldReceive('getRepetition')->andReturn($repetition);
|
||||
$repos->shouldReceive('getRepetition')->andReturn(null);
|
||||
$repos->shouldReceive('getExactAmount')->andReturn('0');
|
||||
|
||||
$this->assertNull($factory->create($transfer, $piggy));
|
||||
|
Loading…
Reference in New Issue
Block a user