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