Skip to content

Firefly III: a personal finances manager

Fixed the tests.

James Cole4113c4ff406e
diff --git a/resources/twig/partials/reports/budgets.twig b/resources/twig/partials/reports/budgets.twig
index 89b55be2b6..018a6d99ab 100644
--- a/resources/twig/partials/reports/budgets.twig
+++ b/resources/twig/partials/reports/budgets.twig
@@ -24,7 +24,7 @@
</td>
<td>
{% if budgetLine.getRepetition %}
- {{ budgetLine.getRepetition.startdate.formatLocalized(monthAndDayFormat) }}
+ <a href="{{ route('budgets.show', [budgetLine.getBudget.id, budgetLine.getRepetition.id]) }}">{{ budgetLine.getRepetition.startdate.formatLocalized(monthAndDayFormat) }}</a>
{% endif %}
</td>
<td>
diff --git a/tests/controllers/BudgetControllerTest.php b/tests/controllers/BudgetControllerTest.php
index 863197d4ed..6fd167c1e4 100644
--- a/tests/controllers/BudgetControllerTest.php
+++ b/tests/controllers/BudgetControllerTest.php
@@ -150,7 +150,7 @@ class BudgetControllerTest extends TestCase
Preferences::shouldReceive('set')->once()->withArgs(['budgetIncomeTotal' . $date, 1001]);
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
@@ -321,7 +321,7 @@ class BudgetControllerTest extends TestCase
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
diff --git a/tests/controllers/HomeControllerTest.php b/tests/controllers/HomeControllerTest.php
index 10edfb7ed5..fed0d45e8d 100644
--- a/tests/controllers/HomeControllerTest.php
+++ b/tests/controllers/HomeControllerTest.php
@@ -103,7 +103,7 @@ class HomeControllerTest extends TestCase
$repository->shouldReceive('getFrontpageTransactions')->once()->andReturn($journals);
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
diff --git a/tests/controllers/JsonControllerTest.php b/tests/controllers/JsonControllerTest.php
index 436a753f47..ad7cc96030 100644
--- a/tests/controllers/JsonControllerTest.php
+++ b/tests/controllers/JsonControllerTest.php
@@ -69,7 +69,7 @@ class JsonControllerTest extends TestCase
public function testBoxBillsUnpaid()
{
$bill = FactoryMuffin::create('FireflyIII\Models\Bill');
- $creditCard = FactoryMuffin::create('FireflyIII\Models\Account');
+ $creditCard = FactoryMuffin::create('FireflyIII\Models\Account');
$ccs = new Collection([$creditCard]);
$collection = new Collection([$bill]);
$ranges = [['start' => new Carbon, 'end' => new Carbon]];
diff --git a/tests/controllers/PreferencesControllerTest.php b/tests/controllers/PreferencesControllerTest.php
index 22c05a0986..b21e47e332 100644
--- a/tests/controllers/PreferencesControllerTest.php
+++ b/tests/controllers/PreferencesControllerTest.php
@@ -60,7 +60,7 @@ class PreferencesControllerTest extends TestCase
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
@@ -78,11 +78,11 @@ class PreferencesControllerTest extends TestCase
'frontPageAccounts' => [1, 2, 3],
'_token' => 'replaceMe',
'viewRange' => '1M',
- 'language' => 'en',
+ 'language' => 'en',
];
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
@@ -93,7 +93,7 @@ class PreferencesControllerTest extends TestCase
Preferences::shouldReceive('set')->once()->withArgs(['language', 'en']);
// language preference:
- $language = FactoryMuffin::create('FireflyIII\Models\Preference');
+ $language = FactoryMuffin::create('FireflyIII\Models\Preference');
$language->data = 'en';
$language->save();
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
diff --git a/tests/controllers/ReportControllerTest.php b/tests/controllers/ReportControllerTest.php
index 8a24d4a220..f52c979da8 100644
--- a/tests/controllers/ReportControllerTest.php
+++ b/tests/controllers/ReportControllerTest.php
@@ -68,7 +68,7 @@ class ReportControllerTest extends TestCase
public function testMonth()
{
- $user = FactoryMuffin::create('FireflyIII\User');
+ $user = FactoryMuffin::create('FireflyIII\User');
FactoryMuffin::create('FireflyIII\Models\Account');
$budget1 = FactoryMuffin::create('FireflyIII\Models\Budget');
$budget1->queryAmount = 12;
@@ -86,6 +86,7 @@ class ReportControllerTest extends TestCase
$helper->shouldReceive('getBudgetReport')->andReturn(new Collection);
$helper->shouldReceive('getCategoryReport')->andReturn(new Collection);
$helper->shouldReceive('getBalanceReport')->andReturn(new Collection);
+ $helper->shouldReceive('getBillReport')->andReturn(new Collection);
$this->call('GET', '/reports/2015/1');
@@ -94,7 +95,7 @@ class ReportControllerTest extends TestCase
public function testMonthShared()
{
- $user = FactoryMuffin::create('FireflyIII\User');
+ $user = FactoryMuffin::create('FireflyIII\User');
FactoryMuffin::create('FireflyIII\Models\Account');
$budget1 = FactoryMuffin::create('FireflyIII\Models\Budget');
$budget1->queryAmount = 12;
@@ -112,6 +113,7 @@ class ReportControllerTest extends TestCase
$helper->shouldReceive('getBudgetReport')->andReturn(new Collection);
$helper->shouldReceive('getCategoryReport')->andReturn(new Collection);
$helper->shouldReceive('getBalanceReport')->andReturn(new Collection);
+ $helper->shouldReceive('getBillReport')->andReturn(new Collection);
$this->call('GET', '/reports/2015/1/shared');
$this->assertResponseOk();
diff --git a/tests/controllers/charts/ChartAccountControllerTest.php b/tests/controllers/charts/ChartAccountControllerTest.php
new file mode 100644
index 0000000000..044a8fdd1c
--- /dev/null
+++ b/tests/controllers/charts/ChartAccountControllerTest.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Class ChartAccountControllerTest
+ */
+class ChartAccountControllerTest 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();
+ }
+
+ public function testAll()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testFrontpage()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testSingle()
+ {
+ $this->markTestIncomplete();
+ }
+}
\ No newline at end of file
diff --git a/tests/controllers/charts/ChartBillControllerTest.php b/tests/controllers/charts/ChartBillControllerTest.php
new file mode 100644
index 0000000000..2b5a7c0cd1
--- /dev/null
+++ b/tests/controllers/charts/ChartBillControllerTest.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * Class ChartBillControllerTest
+ */
+class ChartBillControllerTest 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();
+ }
+
+ public function testFrontpage()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testSingle()
+ {
+ $this->markTestIncomplete();
+ }
+
+
+}
\ No newline at end of file
diff --git a/tests/controllers/charts/ChartBudgetControllerTest.php b/tests/controllers/charts/ChartBudgetControllerTest.php
new file mode 100644
index 0000000000..2588fdbac9
--- /dev/null
+++ b/tests/controllers/charts/ChartBudgetControllerTest.php
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * Class ChartBudgetControllerTest
+ */
+class ChartBudgetControllerTest 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();
+ }
+
+ public function testBudget()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testFrontpage()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testYear()
+ {
+ $this->markTestIncomplete();
+ }
+
+}
\ No newline at end of file
diff --git a/tests/controllers/charts/ChartCategoryControllerTest.php b/tests/controllers/charts/ChartCategoryControllerTest.php
new file mode 100644
index 0000000000..a442f99d8a
--- /dev/null
+++ b/tests/controllers/charts/ChartCategoryControllerTest.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * Class ChartCategoryControllerTest
+ */
+class ChartCategoryControllerTest 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();
+ }
+
+ public function testAll()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testFrontpage()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testMonth()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testYear()
+ {
+ $this->markTestIncomplete();
+ }
+
+}
\ No newline at end of file
diff --git a/tests/controllers/charts/ChartPiggyBankControllerTest.php b/tests/controllers/charts/ChartPiggyBankControllerTest.php
new file mode 100644
index 0000000000..d396458c46
--- /dev/null
+++ b/tests/controllers/charts/ChartPiggyBankControllerTest.php
@@ -0,0 +1,30 @@
+<?php
+
+/**
+ * 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();
+ }
+
+ public function testHistory()
+ {
+ $this->markTestIncomplete();
+ }
+}
\ No newline at end of file
diff --git a/tests/controllers/charts/ChartReportControllerTest.php b/tests/controllers/charts/ChartReportControllerTest.php
new file mode 100644
index 0000000000..d691cb1146
--- /dev/null
+++ b/tests/controllers/charts/ChartReportControllerTest.php
@@ -0,0 +1,35 @@
+<?php
+
+/**
+ * Class ChartReportControllerTest
+ */
+class ChartReportControllerTest 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();
+ }
+
+ public function testYearInOut()
+ {
+ $this->markTestIncomplete();
+ }
+
+ public function testYearInOutSummarized()
+ {
+ $this->markTestIncomplete();
+ }
+}
\ No newline at end of file