Skip to content

Commit

Permalink
Add sorting to GridFieldDetailFormTest fixtures
Browse files Browse the repository at this point in the history
Broke SQLite3 tests in some cases due to random ordering of results.
  • Loading branch information
chillu committed Jul 6, 2012
1 parent 6466993 commit bc1c7f7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/forms/gridfield/GridFieldDetailFormTest.php
Expand Up @@ -63,8 +63,8 @@ public function testViewForm() {
$surname = $parser->getBySelector('#Form_ItemEditForm_Surname');

$this->assertFalse($response->isError());
$this->assertEquals('Joe', (string) $firstName[0]);
$this->assertEquals('Bloggs', (string) $surname[0]);
$this->assertEquals('Jane', (string) $firstName[0]);
$this->assertEquals('Doe', (string) $surname[0]);
}

function testEditForm() {
Expand Down Expand Up @@ -188,6 +188,8 @@ class GridFieldDetailFormTest_Person extends DataObject implements TestOnly {
'Categories' => 'GridFieldDetailFormTest_Category'
);

static $default_sort = 'FirstName';

function getCMSFields() {
$fields = parent::getCMSFields();
// TODO No longer necessary once FormScaffolder uses GridField
Expand All @@ -209,7 +211,9 @@ class GridFieldDetailFormTest_PeopleGroup extends DataObject implements TestOnly
static $has_many = array(
'People' => 'GridFieldDetailFormTest_Person'
);


static $default_sort = 'Name';

function getCMSFields() {
$fields = parent::getCMSFields();
// TODO No longer necessary once FormScaffolder uses GridField
Expand All @@ -232,6 +236,8 @@ class GridFieldDetailFormTest_Category extends DataObject implements TestOnly {
'People' => 'GridFieldDetailFormTest_Person'
);

static $default_sort = 'Name';

function getCMSFields() {
$fields = parent::getCMSFields();
// TODO No longer necessary once FormScaffolder uses GridField
Expand Down

0 comments on commit bc1c7f7

Please sign in to comment.