mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Improve test coverage.
This commit is contained in:
@@ -120,7 +120,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
// different sort when values are positive and when they're negative.
|
||||
asort($data);
|
||||
$next = next($data);
|
||||
if (!\is_bool($next) && 1 === bccomp($next, '0')) {
|
||||
if (!\is_bool($next) && 1 === bccomp((string)$next, '0')) {
|
||||
// next is positive, sort other way around.
|
||||
arsort($data);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class ChartJsGenerator implements GeneratorInterface
|
||||
$index = 0;
|
||||
foreach ($data as $key => $value) {
|
||||
// make larger than 0
|
||||
$chartData['datasets'][0]['data'][] = (float)app('steam')->positive($value);
|
||||
$chartData['datasets'][0]['data'][] = (float)app('steam')->positive((string)$value);
|
||||
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
|
||||
$chartData['labels'][] = $key;
|
||||
++$index;
|
||||
|
@@ -30,6 +30,8 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -24,6 +24,8 @@ namespace FireflyIII\Generator\Report\Account;
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -24,6 +24,8 @@ namespace FireflyIII\Generator\Report\Account;
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -97,6 +97,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Collection $accounts
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setAccounts(Collection $accounts): ReportGeneratorInterface
|
||||
{
|
||||
@@ -111,6 +112,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Collection $budgets
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setBudgets(Collection $budgets): ReportGeneratorInterface
|
||||
{
|
||||
@@ -123,6 +125,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setCategories(Collection $categories): ReportGeneratorInterface
|
||||
{
|
||||
@@ -135,6 +138,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setEndDate(Carbon $date): ReportGeneratorInterface
|
||||
{
|
||||
@@ -149,6 +153,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Collection $expense
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setExpense(Collection $expense): ReportGeneratorInterface
|
||||
{
|
||||
@@ -161,6 +166,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setStartDate(Carbon $date): ReportGeneratorInterface
|
||||
{
|
||||
@@ -175,6 +181,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
* @param Collection $tags
|
||||
*
|
||||
* @return ReportGeneratorInterface
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function setTags(Collection $tags): ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Audit;
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Audit;
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -39,6 +39,8 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Budget;
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Budget;
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -40,6 +40,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Category;
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Category;
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
|
||||
/**
|
||||
* Class ReportGeneratorFactory.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class ReportGeneratorFactory
|
||||
{
|
||||
|
@@ -31,6 +31,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -30,6 +30,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -30,6 +30,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -31,6 +31,7 @@ use Illuminate\Support\Collection;
|
||||
* Class Support.
|
||||
* @method Collection getExpenses()
|
||||
* @method Collection getIncome()
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class Support
|
||||
{
|
||||
|
@@ -42,6 +42,7 @@ use Throwable;
|
||||
|
||||
/**
|
||||
* Class MonthReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MonthReportGenerator extends Support implements ReportGeneratorInterface
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Tag;
|
||||
|
||||
/**
|
||||
* Class MultiYearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Tag;
|
||||
|
||||
/**
|
||||
* Class YearReportGenerator.
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
|
Reference in New Issue
Block a user