mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
Improve code coverage.
This commit is contained in:
@@ -29,6 +29,7 @@ use FireflyIII\Http\Requests\AccountFormRequest;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -132,6 +133,8 @@ class CreateController extends Controller
|
||||
$request->session()->flash('success', (string)trans('firefly.stored_new_account', ['name' => $account->name]));
|
||||
app('preferences')->mark();
|
||||
|
||||
|
||||
|
||||
// update preferences if necessary:
|
||||
$frontPage = app('preferences')->get('frontPageAccounts', [])->data;
|
||||
if (AccountType::ASSET === $account->accountType->type && \count($frontPage) > 0) {
|
||||
|
||||
@@ -161,6 +161,7 @@ class ConvertController extends Controller
|
||||
$errors = $this->repository->convert($journal, $destinationType, $source, $destination);
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
Log::error('Errors while converting: ', $errors->toArray());
|
||||
return redirect(route('transactions.convert.index', [strtolower($destinationType->type), $journal->id]))->withErrors($errors)->withInput();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ class IsDemoUser
|
||||
return response()->redirectTo($previous);
|
||||
}
|
||||
|
||||
return response()->redirectTo(route('index'));
|
||||
return response()->redirectTo(route('index')); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ class Sandstorm
|
||||
* @param string $email
|
||||
*
|
||||
* @return User
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
private function createUser(string $email): User
|
||||
{
|
||||
|
||||
@@ -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'",
|
||||
|
||||
Reference in New Issue
Block a user