MINOR: Fixed tests to suit GridField and DataList API changes

This commit is contained in:
Sam Minnee 2012-03-09 18:11:50 +13:00
parent f288575919
commit 37684837b8
2 changed files with 6 additions and 1 deletions

View File

@ -74,7 +74,7 @@ class GridFieldAddExistingAutocompleterTest_Controller extends Controller implem
function Form() { function Form() {
$player = DataObject::get('GridFieldTest_Player')->find('Email', 'player1@test.com'); $player = DataObject::get('GridFieldTest_Player')->find('Email', 'player1@test.com');
$config = GridFieldConfig::create()->addComponents( $config = GridFieldConfig::create()->addComponents(
$relationComponent = new GridFieldAddExistingAutocompleter('Name'), $relationComponent = new GridFieldAddExistingAutocompleter('before', 'Name'),
new GridFieldDataColumns() new GridFieldDataColumns()
); );
$field = new GridField('testfield', 'testfield', $player->Teams(), $config); $field = new GridField('testfield', 'testfield', $player->Teams(), $config);

View File

@ -206,6 +206,9 @@ class GridFieldDetailFormTest_Controller extends Controller implements TestOnly
->First(); ->First();
$field = new GridField('testfield', 'testfield', $group->People()); $field = new GridField('testfield', 'testfield', $group->People());
$field->getConfig()->addComponent(new GridFieldToolbarHeader());
$field->getConfig()->addComponent(new GridFieldAddNewButton('toolbar-header-right'));
$field->getConfig()->addComponent(new GridFieldEditButton());
$field->getConfig()->addComponent($gridFieldForm = new GridFieldDetailForm($this, 'Form')); $field->getConfig()->addComponent($gridFieldForm = new GridFieldDetailForm($this, 'Form'));
$field->getConfig()->addComponent(new GridFieldEditButton()); $field->getConfig()->addComponent(new GridFieldEditButton());
return new Form($this, 'Form', new FieldList($field), new FieldList()); return new Form($this, 'Form', new FieldList($field), new FieldList());
@ -218,6 +221,8 @@ class GridFieldDetailFormTest_GroupController extends Controller implements Test
function Form() { function Form() {
$field = new GridField('testfield', 'testfield', DataList::create('GridFieldDetailFormTest_PeopleGroup')); $field = new GridField('testfield', 'testfield', DataList::create('GridFieldDetailFormTest_PeopleGroup'));
$field->getConfig()->addComponent($gridFieldForm = new GridFieldDetailForm($this, 'Form')); $field->getConfig()->addComponent($gridFieldForm = new GridFieldDetailForm($this, 'Form'));
$field->getConfig()->addComponent(new GridFieldToolbarHeader());
$field->getConfig()->addComponent(new GridFieldAddNewButton('toolbar-header-right'));
$field->getConfig()->addComponent(new GridFieldEditButton()); $field->getConfig()->addComponent(new GridFieldEditButton());
return new Form($this, 'Form', new FieldList($field), new FieldList()); return new Form($this, 'Form', new FieldList($field), new FieldList());
} }