mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed coverage.
This commit is contained in:
parent
c8183aea51
commit
06c6d6096f
@ -8,7 +8,6 @@ use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Input;
|
||||
use Preferences;
|
||||
use Redirect;
|
||||
@ -191,9 +190,7 @@ class BudgetController extends Controller
|
||||
$journals = $repository->getJournals($budget, $repetition);
|
||||
$limits = !is_null($repetition->id) ? [$repetition->budgetLimit] : $repository->getBudgetLimits($budget);
|
||||
$subTitle = !is_null($repetition->id) ? e($budget->name) . ' in ' . $repetition->startdate->format('F Y') : e($budget->name);
|
||||
if (!$journals instanceof Collection) {
|
||||
$journals->setPath('/budgets/show/' . $budget->id);
|
||||
}
|
||||
$journals->setPath('/budgets/show/' . $budget->id);
|
||||
|
||||
return view('budgets.show', compact('limits', 'budget', 'repetition', 'journals', 'subTitle'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||
|
||||
@ -156,9 +157,11 @@ class BudgetControllerTest extends TestCase
|
||||
$repository = $this->mock('FireflyIII\Repositories\Budget\BudgetRepositoryInterface');
|
||||
$this->be($budget->user);
|
||||
|
||||
$paginator = new LengthAwarePaginator(new Collection, 0, 20, 1);
|
||||
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
||||
Amount::shouldReceive('format')->andReturn('x');
|
||||
$repository->shouldReceive('getJournals')->andReturn(new Collection);
|
||||
$repository->shouldReceive('getJournals')->andReturn($paginator);
|
||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
||||
|
||||
|
||||
@ -309,7 +312,6 @@ class BudgetControllerTest extends TestCase
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||
|
||||
|
||||
|
||||
$this->call('GET', '/budgets/income');
|
||||
$this->assertResponseOk();
|
||||
$this->assertViewHas('amount');
|
||||
|
Loading…
Reference in New Issue
Block a user