mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 16:13:54 +00:00
Some refactoring.
This commit is contained in:
@@ -68,6 +68,19 @@ class AccountControllerCest
|
||||
$I->see('Edit asset account "Delete me"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update an asset account and fail');
|
||||
$I->amOnPage('/accounts/edit/3');
|
||||
$I->see('Edit asset account "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('accounts', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -103,21 +116,6 @@ class AccountControllerCest
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/accounts/create/asset');
|
||||
$I->wantTo('validate a new asset account');
|
||||
$I->see('Create a new asset account');
|
||||
$I->submitForm(
|
||||
'#store', ['name' => 'New through tests.', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
||||
);
|
||||
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -146,6 +144,21 @@ class AccountControllerCest
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/accounts/create/asset');
|
||||
$I->wantTo('validate a new asset account');
|
||||
$I->see('Create a new asset account');
|
||||
$I->submitForm(
|
||||
'#store', ['name' => 'New through tests.', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
||||
);
|
||||
$I->dontSeeRecord('accounts', ['name' => 'New through tests.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -160,34 +173,6 @@ class AccountControllerCest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update an asset account and fail');
|
||||
$I->amOnPage('/accounts/edit/3');
|
||||
$I->see('Edit asset account "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('accounts', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function validateUpdateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update an asset account and validate only');
|
||||
$I->amOnPage('/accounts/edit/2');
|
||||
$I->see('Edit asset account "Savings account"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
||||
);
|
||||
$I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -204,4 +189,19 @@ class AccountControllerCest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function validateUpdateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update an asset account and validate only');
|
||||
$I->amOnPage('/accounts/edit/2');
|
||||
$I->see('Edit asset account "Savings account"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'validate_only']
|
||||
);
|
||||
$I->dontSeeRecord('accounts', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -217,28 +217,6 @@ class BillControllerCest
|
||||
$I->see('Bill "Some bill" updated.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a bill and return to edit it');
|
||||
$I->amOnPage('/bills/edit/1');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => 'Some bill',
|
||||
'match' => 'bla,bla',
|
||||
'amount_min' => 10,
|
||||
'amount_max' => 20,
|
||||
'post_submit_action' => 'return_to_edit',
|
||||
'date' => date('Y-m-d'),
|
||||
'repeat_freq' => 'monthly',
|
||||
'skip' => 0
|
||||
]
|
||||
);
|
||||
$I->see('Bill "Some bill" updated.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -260,4 +238,26 @@ class BillControllerCest
|
||||
$I->see('Could not update bill');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a bill and return to edit it');
|
||||
$I->amOnPage('/bills/edit/1');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => 'Some bill',
|
||||
'match' => 'bla,bla',
|
||||
'amount_min' => 10,
|
||||
'amount_max' => 20,
|
||||
'post_submit_action' => 'return_to_edit',
|
||||
'date' => date('Y-m-d'),
|
||||
'repeat_freq' => 'monthly',
|
||||
'skip' => 0
|
||||
]
|
||||
);
|
||||
$I->see('Bill "Some bill" updated.');
|
||||
}
|
||||
|
||||
}
|
@@ -82,6 +82,19 @@ class BudgetControllerCest
|
||||
$I->see('Edit budget "Delete me"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and fail');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('budgets', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -138,18 +151,6 @@ class BudgetControllerCest
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('validate a new budget');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => 'New budget.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'New budget.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -170,10 +171,21 @@ class BudgetControllerCest
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('make storing a new budget fail.');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'store']);
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'store']);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'New budget.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/create');
|
||||
$I->wantTo('validate a new budget');
|
||||
$I->see('Create a new budget');
|
||||
$I->submitForm('#store', ['name' => 'New budget.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('budgets', ['name' => 'New budget.']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
@@ -192,16 +204,28 @@ class BudgetControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and fail');
|
||||
$I->wantTo('update a budget and return to form');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('budgets', ['name' => 'Delete me']);
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('budgets', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateIncome(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/income');
|
||||
$I->wantTo('update my monthly income');
|
||||
$I->see('Update (expected) income for ');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -217,29 +241,4 @@ class BudgetControllerCest
|
||||
$I->seeRecord('budgets', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a budget and return to form');
|
||||
$I->amOnPage('/budgets/edit/3');
|
||||
$I->see('Edit budget "Delete me"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('budgets', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateIncome(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/budgets/income');
|
||||
$I->wantTo('update my monthly income');
|
||||
$I->see('Update (expected) income for ');
|
||||
}
|
||||
}
|
@@ -65,6 +65,19 @@ class CategoryControllerCest
|
||||
$I->see('Edit category "Delete me"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and fail');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('categories', ['name' => 'Delete me']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -97,19 +110,6 @@ class CategoryControllerCest
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('validate a new category');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => 'New category.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -131,10 +131,24 @@ class CategoryControllerCest
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('make storing a new category fail.');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'validate_only']);
|
||||
$I->submitForm('#store', ['name' => null, 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function storeValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnPage('/categories/create');
|
||||
$I->wantTo('validate a new category');
|
||||
$I->see('Create a new category');
|
||||
$I->submitForm('#store', ['name' => 'New category.', 'post_submit_action' => 'validate_only']);
|
||||
$I->dontSeeRecord('categories', ['name' => 'New category.']);
|
||||
resetToClean::clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -152,13 +166,15 @@ class CategoryControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and fail');
|
||||
$I->wantTo('update a category and return to form');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm('#update', ['name' => '', 'post_submit_action' => 'update']);
|
||||
$I->seeRecord('categories', ['name' => 'Delete me']);
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('categories', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
@@ -178,19 +194,4 @@ class CategoryControllerCest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a category and return to form');
|
||||
$I->amOnPage('/categories/edit/4');
|
||||
$I->see('Edit category "Delete me"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'Savings accountXX', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('categories', ['name' => 'Savings accountXX']);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -35,6 +35,16 @@ class CurrencyControllerCest
|
||||
$I->see('Create a new currency');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function defaultCurrency(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('make US Dollar the default currency');
|
||||
$I->amOnPage('/currency/default/2');
|
||||
$I->see('US Dollar is now the default currency.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -57,16 +67,6 @@ class CurrencyControllerCest
|
||||
$I->see('Currency "Hungarian forint" deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function defaultCurrency(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('make US Dollar the default currency');
|
||||
$I->amOnPage('/currency/default/2');
|
||||
$I->see('US Dollar is now the default currency.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -87,6 +87,19 @@ class CurrencyControllerCest
|
||||
$I->see('Edit currency "US Dollar"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a currency and fail');
|
||||
$I->amOnPage('/currency/edit/2');
|
||||
$I->see('Edit currency "US Dollar"');
|
||||
$I->submitForm('#update', ['name' => 'Failed update', 'code' => '123', 'post_submit_action' => 'update']);
|
||||
$I->dontSeeRecord('transaction_currencies', ['name' => 'Failed update']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -162,13 +175,15 @@ class CurrencyControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function failUpdate(FunctionalTester $I)
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a currency and fail');
|
||||
$I->wantTo('update a currency and return to form');
|
||||
$I->amOnPage('/currency/edit/2');
|
||||
$I->see('Edit currency "US Dollar"');
|
||||
$I->submitForm('#update', ['name' => 'Failed update', 'code' => '123', 'post_submit_action' => 'update']);
|
||||
$I->dontSeeRecord('transaction_currencies', ['name' => 'Failed update']);
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'US DollarXXX', 'symbol' => '$', 'code' => 'USD', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('transaction_currencies', ['name' => 'US DollarXXX']);
|
||||
|
||||
}
|
||||
|
||||
@@ -185,19 +200,4 @@ class CurrencyControllerCest
|
||||
$I->seeRecord('transaction_currencies', ['name' => 'US Dollar']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateAndReturn(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('update a currency and return to form');
|
||||
$I->amOnPage('/currency/edit/2');
|
||||
$I->see('Edit currency "US Dollar"');
|
||||
$I->submitForm(
|
||||
'#update', ['name' => 'US DollarXXX', 'symbol' => '$', 'code' => 'USD', 'post_submit_action' => 'return_to_edit']
|
||||
);
|
||||
$I->seeRecord('transaction_currencies', ['name' => 'US DollarXXX']);
|
||||
|
||||
}
|
||||
}
|
@@ -26,20 +26,20 @@ class GoogleChartControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function accountBalanceChart(FunctionalTester $I)
|
||||
public function accountAllBalanceChart(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the session balance chart of an account.');
|
||||
$I->amOnPage('chart/account/1/session');
|
||||
$I->wantTo('see the complete balance chart of an account.');
|
||||
$I->amOnPage('chart/account/1/all');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function accountAllBalanceChart(FunctionalTester $I)
|
||||
public function accountBalanceChart(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the complete balance chart of an account.');
|
||||
$I->amOnPage('chart/account/1/all');
|
||||
$I->wantTo('see the session balance chart of an account.');
|
||||
$I->amOnPage('chart/account/1/session');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,26 @@ class GoogleChartControllerCest
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function billOverview(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the chart for the history of a bill');
|
||||
$I->amOnPage('/chart/bills/1');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function billsOverview(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the chart for which bills I have yet to pay');
|
||||
$I->amOnPage('/chart/home/bills');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -125,26 +145,6 @@ class GoogleChartControllerCest
|
||||
$I->see('Invalid year');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function piggyBankHistory(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the chart for the history of a piggy bank');
|
||||
$I->amOnPage('/chart/piggy_history/1');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function billOverview(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the chart for the history of a bill');
|
||||
$I->amOnPage('/chart/bills/1');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -158,10 +158,10 @@ class GoogleChartControllerCest
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function billsOverview(FunctionalTester $I)
|
||||
public function piggyBankHistory(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('see the chart for which bills I have yet to pay');
|
||||
$I->amOnPage('/chart/home/bills');
|
||||
$I->wantTo('see the chart for the history of a piggy bank');
|
||||
$I->amOnPage('/chart/piggy_history/1');
|
||||
$I->seeResponseCodeIs(200);
|
||||
}
|
||||
|
||||
|
@@ -211,7 +211,7 @@ class PiggyBankControllerCest
|
||||
'remind_me' => 0,
|
||||
'order' => 3,
|
||||
'account_id' => 1,
|
||||
'targetamount' => 1000]
|
||||
'targetamount' => 1000]
|
||||
);
|
||||
$I->see('Piggy bank "Some new piggy bank" stored.');
|
||||
}
|
||||
@@ -225,14 +225,14 @@ class PiggyBankControllerCest
|
||||
$I->amOnPage('/piggy_banks/create');
|
||||
$I->see('Create new piggy bank');
|
||||
$I->submitForm(
|
||||
'#store', ['name' => null,
|
||||
'rep_every' => 0,
|
||||
'reminder_skip' => 0,
|
||||
'remind_me' => 0,
|
||||
'order' => 3,
|
||||
'account_id' => 1,
|
||||
'#store', ['name' => null,
|
||||
'rep_every' => 0,
|
||||
'reminder_skip' => 0,
|
||||
'remind_me' => 0,
|
||||
'order' => 3,
|
||||
'account_id' => 1,
|
||||
'post_submit_action' => 'store',
|
||||
'targetamount' => 1000]
|
||||
'targetamount' => 1000]
|
||||
);
|
||||
$I->see('The name field is required.');
|
||||
}
|
||||
@@ -281,29 +281,6 @@ class PiggyBankControllerCest
|
||||
$I->see('Piggy bank "Updated camera" updated.');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('validate a piggy bank');
|
||||
$I->amOnPage('/piggy_banks/edit/1');
|
||||
$I->see('Edit piggy bank "New camera"');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => 'Updated camera',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'validate_only',
|
||||
]
|
||||
);
|
||||
$I->see('Updated camera');
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -329,4 +306,27 @@ class PiggyBankControllerCest
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function updateValidateOnly(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('validate a piggy bank');
|
||||
$I->amOnPage('/piggy_banks/edit/1');
|
||||
$I->see('Edit piggy bank "New camera"');
|
||||
$I->submitForm(
|
||||
'#update', [
|
||||
'name' => 'Updated camera',
|
||||
'account_id' => 2,
|
||||
'targetamount' => 2000,
|
||||
'targetdate' => '',
|
||||
'reminder' => 'week',
|
||||
'post_submit_action' => 'validate_only',
|
||||
]
|
||||
);
|
||||
$I->see('Updated camera');
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -85,6 +85,26 @@ class ProfileControllerCest
|
||||
$I->see('Invalid current password!');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function postChangePasswordNoMatch(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('submit a new password but make a mistake in filling it in twice.');
|
||||
$I->amOnPage('/profile/change-password');
|
||||
$I->see('thegrumpydictator@gmail.com');
|
||||
$I->see('Change your password');
|
||||
|
||||
$I->submitForm(
|
||||
'#change-password', [
|
||||
'old' => 'james',
|
||||
'new1' => 'blabla',
|
||||
'new2' => 'bla'
|
||||
]
|
||||
);
|
||||
$I->see('New passwords do not match!');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -126,25 +146,5 @@ class ProfileControllerCest
|
||||
$I->see('The idea is to change your password.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function postChangePasswordNoMatch(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('submit a new password but make a mistake in filling it in twice.');
|
||||
$I->amOnPage('/profile/change-password');
|
||||
$I->see('thegrumpydictator@gmail.com');
|
||||
$I->see('Change your password');
|
||||
|
||||
$I->submitForm(
|
||||
'#change-password', [
|
||||
'old' => 'james',
|
||||
'new1' => 'blabla',
|
||||
'new2' => 'bla'
|
||||
]
|
||||
);
|
||||
$I->see('New passwords do not match!');
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -34,6 +34,16 @@ class ReminderControllerCest
|
||||
$I->see('Money for Weekly reminder for clothes');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function actOnInvalid(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('act on an invalid reminder');
|
||||
$I->amOnPage('/reminders/2/act');
|
||||
$I->see('This reminder has an invalid class connected to it.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
@@ -65,14 +75,4 @@ class ReminderControllerCest
|
||||
$I->see('your piggy bank labelled "Weekly reminder for clothes"');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FunctionalTester $I
|
||||
*/
|
||||
public function actOnInvalid(FunctionalTester $I)
|
||||
{
|
||||
$I->wantTo('act on an invalid reminder');
|
||||
$I->amOnPage('/reminders/2/act');
|
||||
$I->see('This reminder has an invalid class connected to it.');
|
||||
}
|
||||
|
||||
}
|
@@ -109,7 +109,6 @@ class RepeatedExpenseControllerCest
|
||||
]
|
||||
);
|
||||
|
||||
// $I->seeInDatabase('piggy_banks', ['name' => 'TestRepeatedExpense']);
|
||||
$I->see('Piggy bank "TestRepeatedExpense" stored.');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user