MINOR Fixed broken GridFieldPresenterTest assuming IDs

This commit is contained in:
Sean Harvey 2011-10-30 00:13:27 +13:00
parent dd48a605b6
commit f2fba45a77

10
tests/forms/GridFieldPresenterTest.php Normal file → Executable file
View File

@ -47,9 +47,15 @@ class GridFieldPresenterTest extends SapphireTest {
$presenter->setGridField($GridField);
$presenter->sort('Name','desc');
$data = $presenter->Items()->map('ID','Name');
$this->assertEquals(array(2=>'Second Person', 1=>'First Person'), $data);
$this->assertEquals(array(
$this->idFromFixture('GridFieldTest_Person', 'second') => 'Second Person',
$this->idFromFixture('GridFieldTest_Person', 'first') => 'First Person'
), $data);
$presenter->sort('Name','asc');
$data = $presenter->Items()->map('ID','Name');
$this->assertEquals(array(1=>'First Person', 2=>'Second Person'), $data);
$this->assertEquals(array(
$this->idFromFixture('GridFieldTest_Person', 'first') => 'First Person',
$this->idFromFixture('GridFieldTest_Person', 'second') => 'Second Person'
), $data);
}
}