mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed SiteTreeTest to work with new fixture handling: objFromFixture() can no longer be used to determine if an item has been deleted, as it will throw a warning
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81319 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
883be66524
commit
b8736bd5b2
@ -243,27 +243,32 @@ class SiteTreeTest extends SapphireTest {
|
|||||||
|
|
||||||
|
|
||||||
function testDeleteFromStageOperatesRecursively() {
|
function testDeleteFromStageOperatesRecursively() {
|
||||||
$parentPage = $this->objFromFixture('Page', 'about');
|
$pageAbout = $this->objFromFixture('Page', 'about');
|
||||||
$parentPage->delete();
|
$pageStaff = $this->objFromFixture('Page', 'staff');
|
||||||
|
$pageStaffDuplicate = $this->objFromFixture('Page', 'staffduplicate');
|
||||||
|
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'about'));
|
$pageAbout->delete();
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'staff'));
|
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'staffduplicate'));
|
$this->assertFalse(DataObject::get_by_id('Page', $pageAbout->ID));
|
||||||
|
$this->assertFalse(DataObject::get_by_id('Page', $pageStaff->ID));
|
||||||
|
$this->assertFalse(DataObject::get_by_id('Page', $pageStaffDuplicate->ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDeleteFromLiveOperatesRecursively() {
|
function testDeleteFromLiveOperatesRecursively() {
|
||||||
$this->objFromFixture('Page', 'about')->doPublish();
|
$pageAbout = $this->objFromFixture('Page', 'about');
|
||||||
$this->objFromFixture('Page', 'staff')->doPublish();
|
$pageAbout->doPublish();
|
||||||
$this->objFromFixture('Page', 'staffduplicate')->doPublish();
|
$pageStaff = $this->objFromFixture('Page', 'staff');
|
||||||
|
$pageStaff->doPublish();
|
||||||
|
$pageStaffDuplicate = $this->objFromFixture('Page', 'staffduplicate');
|
||||||
|
$pageStaffDuplicate->doPublish();
|
||||||
|
|
||||||
$parentPage = $this->objFromFixture('Page', 'about');
|
$parentPage = $this->objFromFixture('Page', 'about');
|
||||||
$parentPage->doDeleteFromLive();
|
$parentPage->doDeleteFromLive();
|
||||||
|
|
||||||
Versioned::reading_stage('Live');
|
Versioned::reading_stage('Live');
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'about'));
|
$this->assertFalse(DataObject::get_by_id('Page', $pageAbout->ID));
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'staff'));
|
$this->assertFalse(DataObject::get_by_id('Page', $pageStaff->ID));
|
||||||
$this->assertFalse($this->objFromFixture('Page', 'staffduplicate'));
|
$this->assertFalse(DataObject::get_by_id('Page', $pageStaffDuplicate->ID));
|
||||||
Versioned::reading_stage('Stage');
|
Versioned::reading_stage('Stage');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user