mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Dataobject now has enforced ordering
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@87769 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a56db7cff1
commit
e603bb8915
@ -23,19 +23,19 @@ class VersionedTest extends SapphireTest {
|
||||
$this->objFromFixture('Page', 'page3')->delete();
|
||||
|
||||
// Get all items, ignoring deleted
|
||||
$remainingPages = DataObject::get("SiteTree", "\"ParentID\" = 0");
|
||||
$remainingPages = DataObject::get("SiteTree", "\"ParentID\" = 0", "\"SiteTree\".\"ID\" ASC");
|
||||
// Check that page 3 has gone
|
||||
$this->assertNotNull($remainingPages);
|
||||
$this->assertEquals(array("Page 1", "Page 2"), $remainingPages->column('Title'));
|
||||
|
||||
// Get all including deleted
|
||||
$allPages = Versioned::get_including_deleted("SiteTree", "\"ParentID\" = 0");
|
||||
$allPages = Versioned::get_including_deleted("SiteTree", "\"ParentID\" = 0", "\"SiteTree\".\"ID\" ASC");
|
||||
// Check that page 3 is still there
|
||||
$this->assertEquals(array("Page 1", "Page 2", "Page 3"), $allPages->column('Title'));
|
||||
|
||||
// Check that this still works if we switch to reading the other stage
|
||||
Versioned::reading_stage("Live");
|
||||
$allPages = Versioned::get_including_deleted("SiteTree", "\"ParentID\" = 0");
|
||||
$allPages = Versioned::get_including_deleted("SiteTree", "\"ParentID\" = 0", "\"SiteTree\".\"ID\" ASC");
|
||||
$this->assertEquals(array("Page 1", "Page 2", "Page 3"), $allPages->column('Title'));
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user