From bc1c7f766ace6c99a9ffb90d083c81b8c54951a0 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 6 Jul 2012 12:42:04 +0200 Subject: [PATCH] Add sorting to GridFieldDetailFormTest fixtures Broke SQLite3 tests in some cases due to random ordering of results. --- tests/forms/gridfield/GridFieldDetailFormTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/forms/gridfield/GridFieldDetailFormTest.php b/tests/forms/gridfield/GridFieldDetailFormTest.php index 2936ffd3d..c5b310aa8 100644 --- a/tests/forms/gridfield/GridFieldDetailFormTest.php +++ b/tests/forms/gridfield/GridFieldDetailFormTest.php @@ -63,8 +63,8 @@ class GridFieldDetailFormTest extends FunctionalTest { $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() { @@ -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 @@ -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 @@ -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