mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 14:48:11 +00:00
Fix test coverage.
This commit is contained in:
@@ -59,7 +59,7 @@ class NewUserControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('count')->andReturn(0);
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);
|
||||
@@ -79,7 +79,7 @@ class NewUserControllerTest extends TestCase
|
||||
// mock stuff
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('count')->andReturn(1);
|
||||
@@ -99,11 +99,12 @@ class NewUserControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('store')->times(3);
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
|
||||
$currencyRepos->shouldReceive('enable')->once();
|
||||
|
||||
$data = [
|
||||
'bank_name' => 'New bank',
|
||||
@@ -127,12 +128,13 @@ class NewUserControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('store')->times(3);
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn(null);
|
||||
$currencyRepos->shouldReceive('findByCodeNull')->withArgs(['EUR'])->andReturn(TransactionCurrency::find(2))->once();
|
||||
$currencyRepos->shouldReceive('enable')->once();
|
||||
|
||||
$data = [
|
||||
'bank_name' => 'New bank',
|
||||
@@ -156,11 +158,12 @@ class NewUserControllerTest extends TestCase
|
||||
$currencyRepos = $this->mock(CurrencyRepositoryInterface::class);
|
||||
$accountRepos = $this->mock(AccountRepositoryInterface::class);
|
||||
$journalRepos = $this->mock(JournalRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
|
||||
$journalRepos->shouldReceive('firstNull')->once()->andReturn(new TransactionJournal);
|
||||
$accountRepos->shouldReceive('store')->times(3);
|
||||
$currencyRepos->shouldReceive('findNull')->andReturn(TransactionCurrency::find(1));
|
||||
$currencyRepos->shouldReceive('enable')->once();
|
||||
|
||||
$data = [
|
||||
'bank_name' => 'New bank',
|
||||
|
||||
Reference in New Issue
Block a user