BUG: Fixed #4 where exceptions are being thrown due to parsing errors in testSessionController

This commit is contained in:
Kirk Mayo 2014-01-08 09:44:37 +13:00
parent 20efb0c6fa
commit 3ac49cd461

View File

@ -67,10 +67,10 @@ class TestSessionController extends Controller {
);
if($databaseTemplates) {
$fields->push(
(new DropdownField('createDatabaseTemplate', false))
->setSource($databaseTemplates)
->setEmptyString('Empty database')
$createDatabaseTemplate = new DropdownField('createDatabaseTemplate', false)
);
$createDatabaseTemplate->setSource($databaseTemplates);
$createDatabaseTemplate->setEmptyString('Empty database');
}
$fields->merge($this->getBaseFields());
$form = new Form(
@ -111,11 +111,11 @@ class TestSessionController extends Controller {
protected function getBaseFields() {
$fields = new FieldList(
(new TextField('fixture', 'Fixture YAML file path'))
->setAttribute('placeholder', 'Example: framework/tests/security/MemberTest.yml'),
$textField = new TextField('fixture', 'Fixture YAML file path'),
$datetimeField = new DatetimeField('datetime', 'Custom date'),
new HiddenField('flush', null, 1)
);
$textField->setAttribute('placeholder', 'Example: framework/tests/security/MemberTest.yml');
$datetimeField->getDateField()
->setConfig('dateformat', 'yyyy-MM-dd')
->setConfig('showcalendar', true)