From f792c7add7bd32a25d25dc9fe1324de81ec04c49 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 9 Aug 2014 08:51:11 +0200 Subject: [PATCH] Removed some phpstorm marks, updated json controller. --- app/lib/Firefly/Helper/Controllers/Budget.php | 6 --- .../Firefly/Helper/Controllers/Category.php | 6 --- .../Helper/Controllers/CategoryInterface.php | 6 --- app/lib/Firefly/Helper/Controllers/Chart.php | 6 --- .../Helper/Controllers/ChartInterface.php | 6 --- app/lib/Firefly/Helper/Form/FormTrigger.php | 6 --- app/tests/controllers/JsonControllerTest.php | 41 +++++++++++++++++++ 7 files changed, 41 insertions(+), 36 deletions(-) create mode 100644 app/tests/controllers/JsonControllerTest.php diff --git a/app/lib/Firefly/Helper/Controllers/Budget.php b/app/lib/Firefly/Helper/Controllers/Budget.php index d2a9884718..4cab145e0f 100644 --- a/app/lib/Firefly/Helper/Controllers/Budget.php +++ b/app/lib/Firefly/Helper/Controllers/Budget.php @@ -1,10 +1,4 @@ _accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $this->_categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + } + + public function tearDown() + { + Mockery::close(); + } + + public function testBeneficiaries() + { + $beneficiary = f::create('Account'); + + $this->_accounts->shouldReceive('getBeneficiaries')->once()->andReturn([$beneficiary]); + $this->action('GET', 'JsonController@beneficiaries'); + $this->assertResponseOk(); + } + + public function testCategories() + { + $category = f::create('Category'); + $this->_categories->shouldReceive('get')->once()->andReturn([$category]); + $this->action('GET', 'JsonController@categories'); + $this->assertResponseOk(); + } +} \ No newline at end of file