mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +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']);
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user