Improve test coverage.

This commit is contained in:
James Cole
2019-08-03 10:50:43 +02:00
parent b8b59b13a7
commit 75c2529d3e
23 changed files with 367 additions and 539 deletions

View File

@@ -509,6 +509,7 @@ class CurrencyControllerTest extends TestCase
$repository->shouldReceive('update')->andReturn(new TransactionCurrency);
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
$repository->shouldReceive('currencyInUse')->atLeast()->once()->andReturn(true);
Preferences::shouldReceive('mark')->atLeast()->once();
$this->session(['currencies.edit.uri' => 'http://localhost']);

View File

@@ -55,9 +55,9 @@ class ShowControllerTest extends TestCase
$withdrawal = $this->getRandomWithdrawalGroup();
$array = $this->getRandomWithdrawalGroupAsArray();
$array[0]['transactions'][0]['foreign_amount'] = '10';
$array[0]['transactions'][0]['foreign_currency_symbol'] = 'x';
$array[0]['transactions'][0]['foreign_currency_decimal_places'] = 2;
$array['transactions'][0]['foreign_amount'] = '10';
$array['transactions'][0]['foreign_currency_symbol'] = 'x';
$array['transactions'][0]['foreign_currency_decimal_places'] = 2;
$groupRepository = $this->mock(TransactionGroupRepositoryInterface::class);
$userRepos = $this->mock(UserRepositoryInterface::class);
@@ -65,7 +65,7 @@ class ShowControllerTest extends TestCase
// mock for transformer:
$transformer->shouldReceive('setParameters')->atLeast()->once();
$transformer->shouldReceive('transformObject')->atLeast()->once()->andReturn($array[0]);
$transformer->shouldReceive('transformObject')->atLeast()->once()->andReturn($array);
// mock for repos
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->atLeast()->once()->andReturn(true);