Improve test coverage.

This commit is contained in:
James Cole
2019-08-03 04:46:47 +02:00
parent 00dee03709
commit 40dd2e0f7f
21 changed files with 118 additions and 410 deletions

View File

@@ -415,7 +415,7 @@ class RecurrenceFactoryTest extends TestCase
$validator = $this->mock(AccountValidator::class);
// mock calls:
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn(TransactionCurrency::find(1))->once();
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn($this->getEuro())->once();
$piggyFactory->shouldReceive('setUser')->once();
$piggyFactory->shouldReceive('find')->withArgs([1, 'Bla bla'])->andReturn($piggyBank);
@@ -521,7 +521,7 @@ class RecurrenceFactoryTest extends TestCase
$validator = $this->mock(AccountValidator::class);
// mock calls:
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn(TransactionCurrency::find(1))->once();
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn($this->getEuro())->once();
$piggyFactory->shouldReceive('setUser')->once();
$piggyFactory->shouldReceive('find')->withArgs([1, 'Bla bla'])->andReturn(null);
@@ -625,7 +625,7 @@ class RecurrenceFactoryTest extends TestCase
$validator = $this->mock(AccountValidator::class);
// mock calls:
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn(TransactionCurrency::find(1))->once();
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn($this->getEuro())->once();
$piggyFactory->shouldReceive('setUser')->once();
$piggyFactory->shouldReceive('find')->withArgs([1, 'Bla bla'])->andReturn($piggyBank);
@@ -730,7 +730,7 @@ class RecurrenceFactoryTest extends TestCase
$accountFactory = $this->mock(AccountFactory::class);
// mock calls:
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn(TransactionCurrency::find(1))->once();
Amount::shouldReceive('getDefaultCurrencyByUser')->andReturn($this->getEuro())->once();
$piggyFactory->shouldReceive('setUser')->once();
$piggyFactory->shouldReceive('find')->withArgs([1, 'Bla bla'])->andReturn($piggyBank);