Test for opening balance.

This commit is contained in:
James Cole 2015-01-25 10:55:15 +01:00
parent a43238360c
commit 64ce53ac30
2 changed files with 17 additions and 1 deletions

View File

@ -382,7 +382,8 @@ class TransactionJournal implements TransactionJournalInterface, CUDInterface, C
} }
} }
break; break;
case (isset($model['from']) && isset($model['to'])):
break;
default: default:
throw new FireflyException('Cannot validate accounts for transaction journal.'); throw new FireflyException('Cannot validate accounts for transaction journal.');
break; break;

View File

@ -114,6 +114,21 @@ class AccountControllerCest
$I->seeRecord('accounts', ['name' => 'New through tests.']); $I->seeRecord('accounts', ['name' => 'New through tests.']);
} }
/**
* @param FunctionalTester $I
*/
public function storeOpeningBalance(FunctionalTester $I)
{
$I->amOnPage('/accounts/create/asset');
$I->wantTo('store a new asset account with a balance');
$I->see('Create a new asset account');
$I->submitForm('#store', ['name' => 'New through tests with balance.',
'openingBalance' => 10,
'openingBalanceDate' => '2015-01-01',
'what' => 'asset', 'account_role' => 'defaultExpense', 'post_submit_action' => 'store']);
$I->seeRecord('accounts', ['name' => 'New through tests with balance.']);
}
/** /**
* @param FunctionalTester $I * @param FunctionalTester $I
*/ */