Expand test coverage.

This commit is contained in:
James Cole
2017-11-26 09:54:09 +01:00
parent 0cf359b75f
commit 7852f4df1f
8 changed files with 321 additions and 49 deletions

View File

@@ -284,7 +284,7 @@ class AccountController extends Controller
$currencyId = intval($account->getMeta('currency_id'));
$currency = $currencyRepos->find($currencyId);
if (0 === $currencyId) {
$currency = app('amount')->getDefaultCurrency();
$currency = app('amount')->getDefaultCurrency(); // @codeCoverageIgnore
}
// prep for "all" view.
@@ -348,8 +348,10 @@ class AccountController extends Controller
// update preferences if necessary:
$frontPage = Preferences::get('frontPageAccounts', [])->data;
if (count($frontPage) > 0 && AccountType::ASSET === $account->accountType->type) {
// @codeCoverageIgnoreStart
$frontPage[] = $account->id;
Preferences::set('frontPageAccounts', $frontPage);
// @codeCoverageIgnoreEnd
}
if (1 === intval($request->get('create_another'))) {

View File

@@ -137,7 +137,7 @@ class LinkController extends Controller
// put previous url in session if not redirect from store (not "return_to_edit").
if (true !== session('link_types.edit.fromUpdate')) {
$this->rememberPreviousUri('link_types.edit.uri');
$this->rememberPreviousUri('link_types.edit.uri'); // @codeCoverageIgnore
}
$request->session()->forget('link_types.edit.fromUpdate');
@@ -197,7 +197,7 @@ class LinkController extends Controller
// set value so create routine will not overwrite URL:
$request->session()->put('link_types.create.fromStore', true);
return redirect(route('link_types.create', [$request->input('what')]))->withInput();
return redirect(route('admin.links.create'))->withInput();
}
// redirect to previous URL.