Expand test coverage.

This commit is contained in:
James Cole
2019-07-26 17:48:24 +02:00
parent 6ff4a0b45c
commit d94d34ca63
57 changed files with 2243 additions and 1597 deletions

View File

@@ -78,7 +78,7 @@ class ShowController extends Controller
*/
public function show(Request $request, Category $category, Carbon $start = null, Carbon $end = null)
{
Log::debug('Now in show()');
//Log::debug('Now in show()');
/** @var Carbon $start */
$start = $start ?? session('start', Carbon::now()->startOfMonth());
/** @var Carbon $end */
@@ -104,7 +104,7 @@ class ShowController extends Controller
$groups = $collector->getPaginatedGroups();
$groups->setPath($path);
Log::debug('End of show()');
//Log::debug('End of show()');
return view('categories.show', compact('category', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));
}

View File

@@ -77,8 +77,6 @@ class IndexController extends Controller
*/
public function create(string $importProvider)
{
$hasPreReq = (bool)config(sprintf('import.has_prereq.%s', $importProvider));
$hasConfig = (bool)config(sprintf('import.has_job_config.%s', $importProvider));
$allowedForDemo = (bool)config(sprintf('import.allowed_for_demo.%s', $importProvider));
@@ -90,12 +88,13 @@ class IndexController extends Controller
Log::debug(sprintf('Has prerequisites? %s', var_export($hasPreReq, true)));
Log::debug(sprintf('Has config? %s', var_export($hasConfig, true)));
// @codeCoverageIgnoreStart
if ($isDemoUser && !$allowedForDemo) {
Log::debug('User is demo and this provider doesnt work for demo users.');
return redirect(route('import.index'));
}
// @codeCoverageIgnoreEnd
$importJob = $this->repository->create($importProvider);