Built chart tests.

This commit is contained in:
James Cole
2015-05-22 18:31:57 +02:00
parent 1f865d3ea4
commit eecb4db34c
6 changed files with 368 additions and 16 deletions

View File

@@ -1,5 +1,7 @@
<?php
use League\FactoryMuffin\Facade as FactoryMuffin;
/**
* Class ChartPiggyBankControllerTest
*/
@@ -25,6 +27,24 @@ class ChartPiggyBankControllerTest extends TestCase
public function testHistory()
{
$this->markTestIncomplete();
$piggy = FactoryMuffin::create('FireflyIII\Models\PiggyBank');
$this->be($piggy->account->user);
// data:
$obj = new stdClass;
$obj->sum = 100;
$obj->date = '2015-01-01';
$set = [
$obj
];
// mock!
$repository = $this->mock('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
// fake!
$repository->shouldReceive('getEventSummarySet')->andReturn($set);
$this->call('GET', '/chart/piggyBank/' . $piggy->id);
$this->assertResponseOk();
}
}