firefly-iii/tests/controllers/charts/ChartPiggyBankControllerTest.php

54 lines
1.3 KiB
PHP
Raw Normal View History

2015-05-18 10:57:44 -05:00
<?php
2015-05-22 11:31:57 -05:00
use League\FactoryMuffin\Facade as FactoryMuffin;
2015-05-18 10:57:44 -05:00
/**
* Class ChartPiggyBankControllerTest
*/
class ChartPiggyBankControllerTest extends TestCase
{
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
public function setUp()
{
parent::setUp();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
public function tearDown()
{
parent::tearDown();
}
2015-05-23 12:41:54 -05:00
/**
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::history
*/
2015-05-18 10:57:44 -05:00
public function testHistory()
{
2015-05-22 11:31:57 -05:00
$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();
2015-05-18 10:57:44 -05:00
}
2015-05-20 12:56:14 -05:00
}