Improve code coverage.

This commit is contained in:
James Cole
2018-09-07 20:12:22 +02:00
parent d5773ab5d0
commit b33f8b70d4
10 changed files with 299 additions and 130 deletions

View File

@@ -33,6 +33,8 @@ use Log;
/**
* Class Installer
* @codeCoverageIgnore
*
*/
class Installer
{
@@ -48,6 +50,7 @@ class Installer
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*
*/
public function handle($request, Closure $next)
{

View File

@@ -60,7 +60,7 @@ class IsDemoUser
return response()->redirectTo($previous);
}
return response()->redirectTo(route('index'));
return response()->redirectTo(route('index')); // @codeCoverageIgnore
}
return $next($request);

View File

@@ -108,9 +108,11 @@ class Range
private function loseItAll(Request $request): void
{
if ('sqlite' === getenv('DB_CONNECTION') && true === getenv('IS_DOCKER')) {
// @codeCoverageIgnoreStart
$request->session()->flash(
'error', 'You seem to be using SQLite in a Docker container. Don\'t do this. If the container restarts all your data will be gone.'
);
// @codeCoverageIgnoreEnd
}
}

View File

@@ -87,6 +87,7 @@ class Sandstorm
* @param string $email
*
* @return User
* @codeCoverageIgnore
*/
private function createUser(string $email): User
{

View File

@@ -47,7 +47,7 @@ class SecureHeaders
$google = '';
$analyticsId = env('ANALYTICS_ID', '');
if ('' !== $analyticsId) {
$google = 'https://www.google-analytics.com/analytics.js';
$google = 'https://www.google-analytics.com/analytics.js'; // @codeCoverageIgnore
}
$csp = [
"default-src 'none'",