Skip to content
This repository
Browse code

Add sorting to GridFieldDetailFormTest fixtures

Broke SQLite3 tests in some cases due to random ordering of results.
  • Loading branch information...
commit bc1c7f766ace6c99a9ffb90d083c81b8c54951a0 1 parent 6466993
Ingo Schommer authored July 06, 2012
12  tests/forms/gridfield/GridFieldDetailFormTest.php
@@ -63,8 +63,8 @@ public function testViewForm() {
63 63
 		$surname   = $parser->getBySelector('#Form_ItemEditForm_Surname');
64 64
 
65 65
 		$this->assertFalse($response->isError());
66  
-		$this->assertEquals('Joe', (string) $firstName[0]);
67  
-		$this->assertEquals('Bloggs', (string) $surname[0]);
  66
+		$this->assertEquals('Jane', (string) $firstName[0]);
  67
+		$this->assertEquals('Doe', (string) $surname[0]);
68 68
 	}
69 69
 
70 70
 	function testEditForm() {
@@ -188,6 +188,8 @@ class GridFieldDetailFormTest_Person extends DataObject implements TestOnly {
188 188
 		'Categories' => 'GridFieldDetailFormTest_Category'
189 189
 	);
190 190
 
  191
+	static $default_sort = 'FirstName';
  192
+
191 193
 	function getCMSFields() {
192 194
 		$fields = parent::getCMSFields();
193 195
 		// TODO No longer necessary once FormScaffolder uses GridField
@@ -209,7 +211,9 @@ class GridFieldDetailFormTest_PeopleGroup extends DataObject implements TestOnly
209 211
 	static $has_many = array(
210 212
 		'People' => 'GridFieldDetailFormTest_Person'
211 213
 	);
212  
-	
  214
+
  215
+	static $default_sort = 'Name';
  216
+
213 217
 	function getCMSFields() {
214 218
 		$fields = parent::getCMSFields();
215 219
 		// TODO No longer necessary once FormScaffolder uses GridField
@@ -232,6 +236,8 @@ class GridFieldDetailFormTest_Category extends DataObject implements TestOnly {
232 236
 		'People' => 'GridFieldDetailFormTest_Person'
233 237
 	);
234 238
 
  239
+	static $default_sort = 'Name';
  240
+
235 241
 	function getCMSFields() {
236 242
 		$fields = parent::getCMSFields();
237 243
 		// TODO No longer necessary once FormScaffolder uses GridField

0 notes on commit bc1c7f7

Please sign in to comment.
Something went wrong with that request. Please try again.