Fixed the account controller and tests.

This commit is contained in:
James Cole
2014-08-02 12:12:03 +02:00
parent 99500d6201
commit 913b5fd267
11 changed files with 119 additions and 1762 deletions

View File

@@ -1,46 +0,0 @@
<?php
class JsonControllerTest extends TestCase
{
public function setUp()
{
parent::setUp();
}
public function testBeneficiaries()
{
$obj = new stdClass;
$obj->name = 'Bla bla';
// mock account repository:
$accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface');
$accounts->shouldReceive('getBeneficiaries')->andReturn([$obj]);
$this->call('GET', '/json/beneficiaries');
// test
$this->assertResponseOk();
}
public function testCategories()
{
$obj = new stdClass;
$obj->name = 'Bla bla';
// mock category repository:
$categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface');
$categories->shouldReceive('get')->andReturn([$obj]);
$this->call('GET', '/json/categories');
// test
$this->assertResponseOk();
}
public function tearDown()
{
Mockery::close();
}
}