Reversed codeception.

This commit is contained in:
James Cole
2015-07-03 07:27:01 +02:00
parent e139664301
commit d88919474b
77 changed files with 12793 additions and 2511 deletions

View File

@@ -0,0 +1,53 @@
<?php
use League\FactoryMuffin\Facade as FactoryMuffin;
/**
* 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();
}
/**
* @covers FireflyIII\Http\Controllers\Chart\PiggyBankController::history
*/
public function testHistory()
{
$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();
}
}