mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 07:03:23 -06:00
42 lines
999 B
PHP
42 lines
999 B
PHP
<?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();
|
|
}
|
|
}
|