mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Slightly extended tests.
This commit is contained in:
parent
407ba4dd6d
commit
de7db8db78
@ -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']);
|
||||
|
@ -1,13 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
||||
|
||||
/**
|
||||
* Class Budget
|
||||
*/
|
||||
class Budget extends Component
|
||||
{
|
||||
// @codingStandardsIgnoreStart
|
||||
protected $isSubclass = true;
|
||||
// @codingStandardsIgnoreEnd
|
||||
|
||||
use SoftDeletingTrait;
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
|
@ -16,13 +16,11 @@ class Component extends SingleTableInheritanceEntity
|
||||
'name' => 'required|between:1,100|alphabasic',
|
||||
'class' => 'required',
|
||||
];
|
||||
// @codingStandardsIgnoreStart
|
||||
protected $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.
|
||||
|
@ -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">
|
||||
|
@ -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">
|
||||
|
@ -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">
|
||||
|
@ -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 BudgetControllerCest
|
||||
public 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 BudgetControllerCest
|
||||
public 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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user