From fc2cee7a54eec30950e7b365015218d03b6218a3 Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 24 Feb 2017 21:01:33 +0100 Subject: [PATCH] Fixes tests. --- app/Helpers/Chart/MetaPieChart.php | 1 + .../Controllers/Chart/AccountControllerTest.php | 3 +++ .../Controllers/TransactionControllerTest.php | 12 ++++++++++++ 3 files changed, 16 insertions(+) diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php index ba50d55738..7d72637184 100644 --- a/app/Helpers/Chart/MetaPieChart.php +++ b/app/Helpers/Chart/MetaPieChart.php @@ -68,6 +68,7 @@ class MetaPieChart implements MetaPieChartInterface $this->accounts = new Collection; $this->budgets = new Collection; $this->categories = new Collection; + $this->tags = new Collection; } /** diff --git a/tests/Feature/Controllers/Chart/AccountControllerTest.php b/tests/Feature/Controllers/Chart/AccountControllerTest.php index e94470dd4b..d79f1cf9d5 100644 --- a/tests/Feature/Controllers/Chart/AccountControllerTest.php +++ b/tests/Feature/Controllers/Chart/AccountControllerTest.php @@ -18,6 +18,7 @@ class AccountControllerTest extends TestCase { /** * @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseAccounts + * @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::singleSet * @dataProvider dateRangeProvider * * @param string $range @@ -61,6 +62,8 @@ class AccountControllerTest extends TestCase /** * @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage * @covers \FireflyIII\Http\Controllers\Chart\AccountController::__construct + * @covers \FireflyIII\Http\Controllers\Chart\AccountController::accountBalanceChart + * @covers \FireflyIII\Generator\Chart\Basic\GeneratorInterface::multiSet * @dataProvider dateRangeProvider * * @param string $range diff --git a/tests/Feature/Controllers/TransactionControllerTest.php b/tests/Feature/Controllers/TransactionControllerTest.php index 25171bfd85..e89196f637 100644 --- a/tests/Feature/Controllers/TransactionControllerTest.php +++ b/tests/Feature/Controllers/TransactionControllerTest.php @@ -67,6 +67,18 @@ class TransactionControllerTest extends TestCase $response->assertStatus(200); } + /** + * @covers \FireflyIII\Http\Controllers\Controller::redirectToAccount + * @covers \FireflyIII\Http\Controllers\TransactionController::show + */ + public function testShowOpeningBalance() + { + $this->be($this->user()); + $journal = $this->user()->transactionJournals()->where('transaction_type_id',4)->first(); + $response = $this->get(route('transactions.show', [$journal->id])); + $response->assertStatus(302); + } + /** * @covers \FireflyIII\Http\Controllers\TransactionController::show */