When relying on the order of returned objects, sort explicitly as it is nondeterminate for non-MySQL.

This commit is contained in:
Simon Welsh 2011-10-29 14:45:44 +13:00
parent 2c0257e9b9
commit 89ec7e622e

View File

@ -24,7 +24,7 @@ class LeftAndMainTest extends FunctionalTest {
public function testSaveTreeNodeSorting() {
$this->loginWithPermission('ADMIN');
$rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0'); // implicitly sorted
$rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0', '"ID"'); // forcing sorting for non-MySQL
$siblingIDs = $rootPages->column('ID');
$page1 = $rootPages->offsetGet(0);
$page2 = $rootPages->offsetGet(1);
@ -197,4 +197,4 @@ class LeftAndMainTest_Object extends DataObject implements TestOnly {
'Hierarchy'
);
}
}