Improve test coverage

This commit is contained in:
James Cole
2019-07-20 06:22:37 +02:00
parent 4de537ce76
commit 63832b31f8
5 changed files with 201 additions and 302 deletions

View File

@@ -71,6 +71,7 @@ class IndexController extends Controller
* @param Carbon|null $end
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws \Exception
*/
public function index(Request $request, string $objectType, Carbon $start = null, Carbon $end = null)
{
@@ -83,7 +84,7 @@ class IndexController extends Controller
$end = session('end');
}
if (null === $end) {
$end = session('end');
$end = session('end'); // @codeCoverageIgnore
}
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
@@ -141,8 +142,12 @@ class IndexController extends Controller
$collector = app(GroupCollectorInterface::class);
$collector->setRange($start, $end)
->setTypes($types)->setLimit($pageSize)->setPage($page)->withAccountInformation()
->withBudgetInformation()->withCategoryInformation();
->setTypes($types)
->setLimit($pageSize)
->setPage($page)
->withAccountInformation()
->withBudgetInformation()
->withCategoryInformation();
$groups = $collector->getPaginatedGroups();
$groups->setPath($path);