mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Improve test coverage.
This commit is contained in:
@@ -71,7 +71,7 @@ class ReportControllerTest extends TestCase
|
||||
$netWorth->shouldReceive('getNetWorthByCurrency')->andReturn(
|
||||
[
|
||||
[
|
||||
'currency' => TransactionCurrency::first(),
|
||||
'currency' => $this->getEuro(),
|
||||
'balance' => '123',
|
||||
],
|
||||
]
|
||||
|
@@ -111,8 +111,6 @@ class HomeControllerTest extends TestCase
|
||||
$pref = new Preference;
|
||||
$pref->data = [$account->id];
|
||||
Preferences::shouldReceive('get')->withArgs(['frontPageAccounts', [$account->id]])->atLeast()->once()->andReturn($pref);
|
||||
//Preferences::shouldReceive('lastActivity')->atLeast()->once()->andReturn('md512345');
|
||||
//FireflyConfig::shouldReceive('set')->withArgs(['last_update_check', Mockery::any()])->once()->andReturn(new Configuration);
|
||||
Amount::shouldReceive('formatAnything')->atLeast()->once()->andReturn('x');
|
||||
Steam::shouldReceive('balance')->atLeast()->once()->andReturn('5');
|
||||
// mock stuff
|
||||
@@ -123,9 +121,6 @@ class HomeControllerTest extends TestCase
|
||||
$euro = $this->getEuro();
|
||||
|
||||
|
||||
// $currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
//
|
||||
//
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);
|
||||
$accountRepos->shouldReceive('count')->andReturn(1)->atLeast()->once();
|
||||
$accountRepos->shouldReceive('getMetaValue')->withArgs([Mockery::any(), 'currency_id'])->andReturn('1');
|
||||
|
@@ -128,6 +128,7 @@ class JobStatusControllerTest extends TestCase
|
||||
|
||||
$this->mockDefaultSession();
|
||||
$importRepos->shouldReceive('countTransactions')->once()->andReturn(0);
|
||||
$importRepos->shouldReceive('countByTag')->atLeast()->once()->andReturn(0);
|
||||
|
||||
// call thing.
|
||||
$this->be($this->user());
|
||||
@@ -155,6 +156,7 @@ class JobStatusControllerTest extends TestCase
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$importRepos->shouldReceive('countTransactions')->once()->andReturn(2);
|
||||
$importRepos->shouldReceive('countByTag')->atLeast()->once()->andReturn(2);
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
@@ -191,6 +193,7 @@ class JobStatusControllerTest extends TestCase
|
||||
$this->mockDefaultSession();
|
||||
|
||||
$importRepos->shouldReceive('countTransactions')->once()->andReturn(1);
|
||||
$importRepos->shouldReceive('countByTag')->atLeast()->once()->andReturn(1);
|
||||
|
||||
$job = new ImportJob;
|
||||
$job->user_id = $this->user()->id;
|
||||
|
@@ -130,7 +130,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);
|
||||
|
||||
// new account list thing.
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn($currency);
|
||||
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
@@ -207,7 +207,7 @@ class PiggyBankControllerTest extends TestCase
|
||||
|
||||
|
||||
// mock stuff for new account list thing.
|
||||
$currency = TransactionCurrency::first();
|
||||
$currency = $this->getEuro();
|
||||
$account = $this->getRandomAsset();
|
||||
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn($currency);
|
||||
|
Reference in New Issue
Block a user