Fixed tests.

This commit is contained in:
James Cole
2015-07-01 16:41:59 +02:00
parent 5ae236e016
commit ec349b31c7
4 changed files with 23 additions and 6 deletions

View File

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

View File

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