function tearDown()
 {
     parent::tearDown();
     // Static publishing will just confuse things
     StaticPublisher::$disable_realtime = false;
     i18n::set_locale($this->origLocale);
 }
 function tearDown()
 {
     parent::tearDown();
     // Static publishing will just confuse things
     StaticPublisher::$disable_realtime = false;
 }
 function testUnpublishingParentPageUnpublishesSubsiteVirtualPages()
 {
     StaticPublisher::$disable_realtime = true;
     // Go to main site, get parent page
     $subsite = $this->objFromFixture('Subsite_Template', 'main');
     Subsite::changeSubsite($subsite->ID);
     $page = $this->objFromFixture('SiteTree', 'importantpage');
     // Create two SVPs on other subsites
     $subsite = $this->objFromFixture('Subsite_Template', 'subsite1');
     Subsite::changeSubsite($subsite->ID);
     $vp1 = new SubsitesVirtualPage();
     $vp1->CopyContentFromID = $page->ID;
     $vp1->write();
     $vp1->doPublish();
     $subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
     Subsite::changeSubsite($subsite->ID);
     $vp2 = new SubsitesVirtualPage();
     $vp2->CopyContentFromID = $page->ID;
     $vp2->write();
     $vp2->doPublish();
     // Switch back to main site, unpublish source
     $subsite = $this->objFromFixture('Subsite_Template', 'main');
     Subsite::changeSubsite($subsite->ID);
     $page = $this->objFromFixture('SiteTree', 'importantpage');
     $page->doUnpublish();
     Subsite::changeSubsite($vp1->SubsiteID);
     $onLive = Versioned::get_one_by_stage('SubsitesVirtualPage', 'Live', "\"SiteTree_Live\".\"ID\" = " . $vp1->ID);
     $this->assertFalse($onLive, 'SVP has been removed from live');
     $subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
     Subsite::changeSubsite($vp2->SubsiteID);
     $onLive = Versioned::get_one_by_stage('SubsitesVirtualPage', 'Live', "\"SiteTree_Live\".\"ID\" = " . $vp2->ID);
     $this->assertFalse($onLive, 'SVP has been removed from live');
 }
 function tearDown()
 {
     SiteTreeFutureState::set_future_datetime(null);
     Versioned::reading_stage('Stage');
     parent::tearDown();
     // Static publishing will just confuse things
     StaticPublisher::$disable_realtime = false;
 }