mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improve test coverage.
This commit is contained in:
@@ -216,7 +216,7 @@ class AvailableBudgetControllerTest extends TestCase
|
||||
// mock calls:
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('updateAvailableBudget')->once()->andReturn($availableBudget);
|
||||
$currencyRepository->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
|
||||
$currencyRepository->shouldReceive('findNull')->andReturn($this->getEuro());
|
||||
|
||||
// data to submit
|
||||
$data = [
|
||||
|
@@ -62,7 +62,7 @@ class CurrencyControllerTest extends TestCase
|
||||
public function testStore(): void
|
||||
{
|
||||
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$transformer = $this->mock(CurrencyTransformer::class);
|
||||
$this->mock(UserRepositoryInterface::class);
|
||||
@@ -105,7 +105,7 @@ class CurrencyControllerTest extends TestCase
|
||||
*/
|
||||
public function testStoreWithDefault(): void
|
||||
{
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$transformer = $this->mock(CurrencyTransformer::class);
|
||||
$userRepository = $this->mock(UserRepositoryInterface::class);
|
||||
@@ -151,7 +151,7 @@ class CurrencyControllerTest extends TestCase
|
||||
*/
|
||||
public function testUpdate(): void
|
||||
{
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$transformer = $this->mock(CurrencyTransformer::class);
|
||||
$this->mock(UserRepositoryInterface::class);
|
||||
@@ -191,7 +191,7 @@ class CurrencyControllerTest extends TestCase
|
||||
*/
|
||||
public function testUpdateWithDefault(): void
|
||||
{
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$repository = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$transformer = $this->mock(CurrencyTransformer::class);
|
||||
$this->mock(UserRepositoryInterface::class);
|
||||
|
@@ -154,7 +154,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
$accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
|
||||
$currencyRepos->shouldReceive('setUser');
|
||||
$currencyRepos->shouldReceive('findNull')->withArgs([1])->andReturn(TransactionCurrency::first());
|
||||
$currencyRepos->shouldReceive('findNull')->withArgs([1])->andReturn($this->getEuro());
|
||||
|
||||
$data = [
|
||||
'name' => 'new pigy bank ' . $this->randomInt(),
|
||||
|
@@ -69,7 +69,7 @@ class SummaryControllerTest extends TestCase
|
||||
$netWorth = $this->mock(NetWorthInterface::class);
|
||||
|
||||
// data
|
||||
$euro = TransactionCurrency::find(1);
|
||||
$euro = $this->getEuro();
|
||||
$budget = $this->user()->budgets()->inRandomOrder()->first();
|
||||
$account = $this->getRandomAsset();
|
||||
$journals = [
|
||||
@@ -162,7 +162,7 @@ class SummaryControllerTest extends TestCase
|
||||
$date->addWeek();
|
||||
|
||||
// data
|
||||
$euro = TransactionCurrency::find(1);
|
||||
$euro = $this->getEuro();
|
||||
$budget = $this->user()->budgets()->inRandomOrder()->first();
|
||||
$account = $this->getRandomAsset();
|
||||
$journals = [
|
||||
|
Reference in New Issue
Block a user