mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improve test coverage.
This commit is contained in:
@@ -207,7 +207,7 @@ class JournalFormRequest extends Request
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new FireflyException('Cannot handle transaction type of type ' . e($what) . ' . ');
|
||||
throw new FireflyException(sprintf('Cannot handle transaction type of type "%s"', $what)); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@@ -47,7 +47,7 @@ class ReconciliationStoreRequest extends Request
|
||||
{
|
||||
$transactions = $this->get('transactions');
|
||||
if (!is_array($transactions)) {
|
||||
$transactions = [];
|
||||
$transactions = []; // @codeCoverageIgnore
|
||||
}
|
||||
$data = [
|
||||
'start' => $this->date('start'),
|
||||
|
@@ -122,9 +122,12 @@ class ReportFormRequest extends Request
|
||||
if (2 === count($parts)) {
|
||||
try {
|
||||
$date = new Carbon($parts[1]);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Exception $e) {
|
||||
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $date;
|
||||
@@ -165,8 +168,10 @@ class ReportFormRequest extends Request
|
||||
if (2 === count($parts)) {
|
||||
try {
|
||||
$date = new Carbon($parts[0]);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (Exception $e) {
|
||||
throw new FireflyException(sprintf('"%s" is not a valid date range.', $range));
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -120,15 +120,4 @@ class Request extends FormRequest
|
||||
{
|
||||
return $this->get($field) ? new Carbon($this->get($field)) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $field
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
protected function float(string $field): float
|
||||
{
|
||||
return round($this->input($field), 12);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user