Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fixed tests.
James Coleec349b31c79b
diff --git a/phpunit.xml b/phpunit.xmlindex 4f2b91ded5..6b3ab70282 100644--- a/phpunit.xml+++ b/phpunit.xml@@ -20,10 +20,11 @@</whitelist></filter>- <!-- code coverage -->+ <!-- code coverage<logging><log type="coverage-clover" target="./build/logs/clover.xml" charset="UTF-8" /></logging>+ --><php><env name="APP_ENV" value="testing"/>diff --git a/public/js/reports.js b/public/js/reports.jsindex 0a790fa256..0c63642830 100644--- a/public/js/reports.js+++ b/public/js/reports.js@@ -12,15 +12,15 @@ $(function () {function drawChart() {"use strict";- if (typeof columnChart !== undefined) {+ if (typeof columnChart !== 'undefined' && typeof year !== 'undefined' && typeof month === 'undefined') {columnChart('chart/report/in-out/' + year + shared, 'income-expenses-chart');columnChart('chart/report/in-out-sum/' + year + shared, 'income-expenses-sum-chart');}- if (typeof stackedColumnChart !== undefined) {+ if (typeof stackedColumnChart !== 'undefined' && typeof year !== 'undefined' && typeof month === 'undefined') {stackedColumnChart('chart/budget/year/' + year + shared, 'budgets');stackedColumnChart('chart/category/year/' + year + shared, 'categories');}- if (typeof lineChart !== undefined && typeof month !== 'undefined') {+ if (typeof lineChart !== 'undefined' && typeof month !== 'undefined') {lineChart('/chart/account/month/' + year + '/' + month + shared, 'account-balances-chart');}}diff --git a/tests/generators/ChartJsBudgetChartGeneratorTest.php b/tests/generators/ChartJsBudgetChartGeneratorTest.phpindex 7381287ad2..4fe5e2290e 100644--- a/tests/generators/ChartJsBudgetChartGeneratorTest.php+++ b/tests/generators/ChartJsBudgetChartGeneratorTest.php@@ -41,10 +41,17 @@ class ChartJsBudgetChartGeneratorTest extends TestCase*/public function testBudget(){+ $preference = FactoryMuffin::create('FireflyIII\Models\Preference');+ $preference->data = 'en';+ $preference->save();++ // mock language preference:+ Preferences::shouldReceive('get')->withArgs(['language', 'en'])->andReturn($preference);+// make a collection with some amounts in them.$collection = new Collection;for ($i = 0; $i < 5; $i++) {- $collection->push([null, 100]);+ $collection->push([new Carbon, 100]);}$data = $this->object->budget($collection);diff --git a/tests/generators/ChartJsCategoryChartGeneratorTest.php b/tests/generators/ChartJsCategoryChartGeneratorTest.phpindex d90276cc46..3b75f4361a 100644--- a/tests/generators/ChartJsCategoryChartGeneratorTest.php+++ b/tests/generators/ChartJsCategoryChartGeneratorTest.php@@ -42,10 +42,19 @@ class ChartJsCategoryChartGeneratorTest extends TestCase*/public function testAll(){++ $preference = FactoryMuffin::create('FireflyIII\Models\Preference');+ $preference->data = 'en';+ $preference->save();++ // mock language preference:+ Preferences::shouldReceive('get')->withArgs(['language', 'en'])->andReturn($preference);++// make a collection of stuff:$collection = new Collection;for ($i = 0; $i < 5; $i++) {- $collection->push([null, 100]);+ $collection->push([new Carbon, 100]);}$data = $this->object->all($collection);