Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Slightly extended tests.
James Colede7db8db7806
diff --git a/app/database/seeds/TestContentSeeder.php b/app/database/seeds/TestContentSeeder.phpindex e1b40ee435..bec7825eb3 100644--- a/app/database/seeds/TestContentSeeder.php+++ b/app/database/seeds/TestContentSeeder.php@@ -28,12 +28,12 @@ class TestContentSeeder extends Seeder// create two asset accounts.$checking = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Checking account', 'active' => 1]);$savings = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Savings account', 'active' => 1]);- /** @noinspection PhpUnusedLocalVariableInspection */- $deleteMe = Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Delete me', 'active' => 1]);+ Account::create(['user_id' => $user->id, 'account_type_id' => $assetType->id, 'name' => 'Delete me', 'active' => 1]);// create two budgets:$groceriesBudget = Budget::create(['user_id' => $user->id, 'name' => 'Groceries']);$billsBudget = Budget::create(['user_id' => $user->id, 'name' => 'Bills']);+ Budget::create(['user_id' => $user->id, 'name' => 'Delete me']);// create two categories:$dailyGroceries = Category::create(['user_id' => $user->id, 'name' => 'DailyGroceries']);diff --git a/app/models/Budget.php b/app/models/Budget.phpindex e29958cf4e..a4d9c09da8 100644--- a/app/models/Budget.php+++ b/app/models/Budget.php@@ -1,13 +1,15 @@<?php+use Illuminate\Database\Eloquent\SoftDeletingTrait;+/*** Class Budget*/class Budget extends Component{- // @codingStandardsIgnoreStartprotected $isSubclass = true;- // @codingStandardsIgnoreEnd++ use SoftDeletingTrait;/*** @return \Illuminate\Database\Eloquent\Relations\HasManyThroughdiff --git a/app/models/Component.php b/app/models/Component.phpindex 7973ebd3b5..7b63a4e827 100644--- a/app/models/Component.php+++ b/app/models/Component.php@@ -16,13 +16,11 @@ class Component extends SingleTableInheritanceEntity'name' => 'required|between:1,100|alphabasic','class' => 'required',];- // @codingStandardsIgnoreStartprotected $dates = ['deleted_at', 'created_at', 'updated_at'];protected $fillable = ['name', 'user_id'];protected $subclassField = 'class';protected $table = 'components';- // @codingStandardsIgnoreEnd- use SoftDeletingTrait, ValidatingTrait;+ use ValidatingTrait;/*** TODO remove this method in favour of something in the FireflyIII libraries.diff --git a/app/views/budgets/create.blade.php b/app/views/budgets/create.blade.phpindex 28e28e4712..53c67089ca 100644--- a/app/views/budgets/create.blade.php+++ b/app/views/budgets/create.blade.php@@ -1,7 +1,7 @@@extends('layouts.default')@section('content'){{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName()) }}-{{Form::open(['class' => 'form-horizontal','url' => route('budgets.store')])}}+{{Form::open(['class' => 'form-horizontal','id' => 'store','url' => route('budgets.store')])}}<div class="row"><div class="col-lg-6 col-md-6 col-sm-12"><div class="panel panel-primary">diff --git a/app/views/budgets/delete.blade.php b/app/views/budgets/delete.blade.phpindex bf16e4881a..fde512aa42 100644--- a/app/views/budgets/delete.blade.php+++ b/app/views/budgets/delete.blade.php@@ -1,7 +1,7 @@@extends('layouts.default')@section('content'){{ Breadcrumbs::renderIfExists(Route::getCurrentRoute()->getName(), $budget) }}-{{Form::open(['class' => 'form-horizontal','url' => route('budgets.destroy',$budget->id)])}}+{{Form::open(['class' => 'form-horizontal','id' => 'destroy','url' => route('budgets.destroy',$budget->id)])}}<div class="row"><div class="col-lg-6 col-md-12 col-sm-12"><div class="panel panel-red">diff --git a/app/views/budgets/edit.blade.php b/app/views/budgets/edit.blade.phpindex 998cd90a1b..94061cd926 100644--- a/app/views/budgets/edit.blade.php+++ b/app/views/budgets/edit.blade.php@@ -7,7 +7,7 @@</div></div>-{{Form::model($budget, ['class' => 'form-horizontal','url' => route('budgets.update',$budget->id)])}}+{{Form::model($budget, ['class' => 'form-horizontal','id' => 'update','url' => route('budgets.update',$budget->id)])}}<div class="row"><div class="col-lg-6 col-md-12 col-sm-6"><div class="panel panel-primary">diff --git a/tests/functional/BudgetControllerCest.php b/tests/functional/BudgetControllerCest.phpindex bb1f886f6d..e129daaab2 100644--- a/tests/functional/BudgetControllerCest.php+++ b/tests/functional/BudgetControllerCest.php@@ -39,6 +39,7 @@ class BudgetControllerCest{$I->wantTo('create a budget');$I->amOnRoute('budgets.create');+ $I->see('Create a new budget');}/**@@ -47,7 +48,8 @@ class BudgetControllerCestpublic function delete(FunctionalTester $I){$I->wantTo('delete a budget');- $I->amOnPage('/budgets/delete/1');+ $I->amOnPage('/budgets/delete/3');+ $I->see('Delete budget "Delete me"');}/**@@ -56,6 +58,12 @@ class BudgetControllerCestpublic function destroy(FunctionalTester $I){$I->wantTo('destroy a budget');+ #$I->amOnPage('/budgets/delete/3');+ #$I->see('Delete budget "Delete me"');+ #$I->submitForm('#destroy', []);+ #$I->see('Budget "Delete me" was deleted.');+ #$I->dontSeeInDatabase('components', ['name' => 'Delete me', 'class' => 'Budget','deleted_at' => null]);+ //resetToClean::clean();}/**