Improve test coverage.

This commit is contained in:
James Cole
2018-08-24 07:18:33 +02:00
parent b174a06b86
commit 2b54363dd7
42 changed files with 1573 additions and 23 deletions

View File

@@ -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;

View File

@@ -30,6 +30,8 @@ use Throwable;
/**
* Class MonthReportGenerator.
*
* @codeCoverageIgnore
*/
class MonthReportGenerator implements ReportGeneratorInterface
{

View File

@@ -24,6 +24,8 @@ namespace FireflyIII\Generator\Report\Account;
/**
* Class MultiYearReportGenerator.
*
* @codeCoverageIgnore
*/
class MultiYearReportGenerator extends MonthReportGenerator
{

View File

@@ -24,6 +24,8 @@ namespace FireflyIII\Generator\Report\Account;
/**
* Class YearReportGenerator.
*
* @codeCoverageIgnore
*/
class YearReportGenerator extends MonthReportGenerator
{

View File

@@ -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
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Audit;
/**
* Class MultiYearReportGenerator.
* @codeCoverageIgnore
*/
class MultiYearReportGenerator extends MonthReportGenerator
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Audit;
/**
* Class YearReportGenerator.
* @codeCoverageIgnore
*/
class YearReportGenerator extends MonthReportGenerator
{

View File

@@ -39,6 +39,8 @@ use Throwable;
/**
* Class MonthReportGenerator.
*
* @codeCoverageIgnore
*/
class MonthReportGenerator extends Support implements ReportGeneratorInterface
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Budget;
/**
* Class MultiYearReportGenerator.
* @codeCoverageIgnore
*/
class MultiYearReportGenerator extends MonthReportGenerator
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Budget;
/**
* Class YearReportGenerator.
* @codeCoverageIgnore
*/
class YearReportGenerator extends MonthReportGenerator
{

View File

@@ -40,6 +40,7 @@ use Throwable;
/**
* Class MonthReportGenerator.
* @codeCoverageIgnore
*/
class MonthReportGenerator extends Support implements ReportGeneratorInterface
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Category;
/**
* Class MultiYearReportGenerator.
* @codeCoverageIgnore
*/
class MultiYearReportGenerator extends MonthReportGenerator
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Category;
/**
* Class YearReportGenerator.
* @codeCoverageIgnore
*/
class YearReportGenerator extends MonthReportGenerator
{

View File

@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
/**
* Class ReportGeneratorFactory.
* @codeCoverageIgnore
*/
class ReportGeneratorFactory
{

View File

@@ -31,6 +31,7 @@ use Throwable;
/**
* Class MonthReportGenerator.
* @codeCoverageIgnore
*/
class MonthReportGenerator implements ReportGeneratorInterface
{

View File

@@ -30,6 +30,7 @@ use Throwable;
/**
* Class MonthReportGenerator.
* @codeCoverageIgnore
*/
class MultiYearReportGenerator implements ReportGeneratorInterface
{

View File

@@ -30,6 +30,7 @@ use Throwable;
/**
* Class MonthReportGenerator.
* @codeCoverageIgnore
*/
class YearReportGenerator implements ReportGeneratorInterface
{

View File

@@ -31,6 +31,7 @@ use Illuminate\Support\Collection;
* Class Support.
* @method Collection getExpenses()
* @method Collection getIncome()
* @codeCoverageIgnore
*/
class Support
{

View File

@@ -42,6 +42,7 @@ use Throwable;
/**
* Class MonthReportGenerator.
* @codeCoverageIgnore
*/
class MonthReportGenerator extends Support implements ReportGeneratorInterface
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Tag;
/**
* Class MultiYearReportGenerator.
* @codeCoverageIgnore
*/
class MultiYearReportGenerator extends MonthReportGenerator
{

View File

@@ -24,6 +24,7 @@ namespace FireflyIII\Generator\Report\Tag;
/**
* Class YearReportGenerator.
* @codeCoverageIgnore
*/
class YearReportGenerator extends MonthReportGenerator
{