mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-17 07:08:19 +00:00
Improve test coverage.
This commit is contained in:
@@ -166,14 +166,17 @@ class BillControllerTest extends TestCase
|
||||
$userRepos = $this->mock(UserRepositoryInterface::class);
|
||||
$transformer = $this->mock(BillTransformer::class);
|
||||
$euro = $this->getEuro();
|
||||
$pref = new Preference;
|
||||
$pref->data = 50;
|
||||
Preferences::shouldReceive('get')->withArgs(['listPageSize', 50])->atLeast()->once()->andReturn($pref);
|
||||
//$pref = new Preference;
|
||||
//$pref->data = 50;
|
||||
//Preferences::shouldReceive('get')->withArgs(['listPageSize', 50])->atLeast()->once()->andReturn($pref);
|
||||
Amount::shouldReceive('formatAnything')->andReturn('-100');
|
||||
|
||||
$transformer->shouldReceive('setParameters')->atLeast()->once();
|
||||
$transformer->shouldReceive('transform')->atLeast()->once()->andReturn(
|
||||
['id' => 5, 'active' => true, 'name' => 'x', 'next_expected_match' => '2018-01-01',
|
||||
['id' => 5, 'active' => true,
|
||||
'name' => 'x', 'next_expected_match' => '2018-01-01',
|
||||
'amount_min' => '10',
|
||||
'amount_max' => '10',
|
||||
'currency' => $this->getEuro(),
|
||||
'currency_id' => $euro->id,
|
||||
'currency_code' => $euro->code,
|
||||
@@ -185,7 +188,7 @@ class BillControllerTest extends TestCase
|
||||
$userRepos->shouldReceive('hasRole')->withArgs([Mockery::any(), 'owner'])->andReturn(true)->atLeast()->once();
|
||||
|
||||
$collection = new Collection([$bill]);
|
||||
$repository->shouldReceive('getPaginator')->andReturn(new LengthAwarePaginator($collection, 1, 50))->once();
|
||||
$repository->shouldReceive('getBills')->andReturn($collection)->once();
|
||||
$repository->shouldReceive('setUser');
|
||||
$repository->shouldReceive('getNoteText')->andReturn('Hi there');
|
||||
$repository->shouldReceive('getRulesForBills')->andReturn([]);
|
||||
|
||||
Reference in New Issue
Block a user