mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixed tests.
This commit is contained in:
parent
5ae236e016
commit
ec349b31c7
@ -20,10 +20,11 @@
|
|||||||
</whitelist>
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
|
|
||||||
<!-- code coverage -->
|
<!-- code coverage
|
||||||
<logging>
|
<logging>
|
||||||
<log type="coverage-clover" target="./build/logs/clover.xml" charset="UTF-8" />
|
<log type="coverage-clover" target="./build/logs/clover.xml" charset="UTF-8" />
|
||||||
</logging>
|
</logging>
|
||||||
|
-->
|
||||||
|
|
||||||
<php>
|
<php>
|
||||||
<env name="APP_ENV" value="testing"/>
|
<env name="APP_ENV" value="testing"/>
|
||||||
|
@ -12,15 +12,15 @@ $(function () {
|
|||||||
|
|
||||||
function drawChart() {
|
function drawChart() {
|
||||||
"use strict";
|
"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/' + year + shared, 'income-expenses-chart');
|
||||||
columnChart('chart/report/in-out-sum/' + year + shared, 'income-expenses-sum-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/budget/year/' + year + shared, 'budgets');
|
||||||
stackedColumnChart('chart/category/year/' + year + shared, 'categories');
|
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');
|
lineChart('/chart/account/month/' + year + '/' + month + shared, 'account-balances-chart');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,17 @@ class ChartJsBudgetChartGeneratorTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testBudget()
|
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.
|
// make a collection with some amounts in them.
|
||||||
$collection = new Collection;
|
$collection = new Collection;
|
||||||
for ($i = 0; $i < 5; $i++) {
|
for ($i = 0; $i < 5; $i++) {
|
||||||
$collection->push([null, 100]);
|
$collection->push([new Carbon, 100]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->object->budget($collection);
|
$data = $this->object->budget($collection);
|
||||||
|
@ -42,10 +42,19 @@ class ChartJsCategoryChartGeneratorTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testAll()
|
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:
|
// make a collection of stuff:
|
||||||
$collection = new Collection;
|
$collection = new Collection;
|
||||||
for ($i = 0; $i < 5; $i++) {
|
for ($i = 0; $i < 5; $i++) {
|
||||||
$collection->push([null, 100]);
|
$collection->push([new Carbon, 100]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $this->object->all($collection);
|
$data = $this->object->all($collection);
|
||||||
|
Loading…
Reference in New Issue
Block a user