Expand code coverage.

This commit is contained in:
James Cole
2018-09-15 13:44:36 +02:00
parent 57b4a5be08
commit d9f515900c
8 changed files with 379 additions and 45 deletions

View File

@@ -275,7 +275,12 @@ class JournalFormRequest extends Request
$selectedCurrency = (int)($data['amount_currency_id_amount'] ?? 0);
$accountCurrency = (int)($data['destination_account_currency'] ?? 0);
$nativeAmount = (string)($data['native_amount'] ?? '');
Log::debug('Now in validateDeposit.');
Log::debug(sprintf('SelectedCurrency is "%s", accountCurrency is "%s", native amount is "%s".', $selectedCurrency, $accountCurrency, $nativeAmount));
if ($selectedCurrency !== $accountCurrency && '' === $nativeAmount && 0 !== $selectedCurrency && 0 !== $accountCurrency) {
Log::debug('Adding an error about missing native amount.');
$validator->errors()->add('native_amount', (string)trans('validation.numeric_native'));
return;

View File

@@ -208,8 +208,10 @@ class ReportFormRequest extends Request
$repository = app(TagRepositoryInterface::class);
$set = $this->get('tag');
$collection = new Collection;
Log::debug('Set is:', $set ?? []);
if (\is_array($set)) {
foreach ($set as $tagTag) {
Log::debug(sprintf('Now searching for "%s"', $tagTag));
$tag = $repository->findByTag($tagTag);
if (null !== $tag) {
$collection->push($tag);

View File

@@ -27,6 +27,7 @@ use Illuminate\Foundation\Http\FormRequest;
/**
* Class Request.
* @codeCoverageIgnore
*
* @SuppressWarnings(PHPMD.NumberOfChildren)
*/