silverstripe-subsites/tests/SubsitesVirtualPageTest.php

27 lines
744 B
PHP
Raw Normal View History

2010-03-01 03:56:19 +01:00
<?php
class SubsitesVirtualPageTest extends SapphireTest {
static $fixture_file = 'subsites/tests/SubsiteTest.yml';
// Attempt to bring main:linky to subsite2:linky
function testVirtualPageFromAnotherSubsite() {
2010-03-01 03:58:13 +01:00
Subsite::$write_hostmap = false;
2010-03-01 03:56:19 +01:00
$subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
Subsite::changeSubsite($subsite->ID);
Subsite::$disable_subsite_filter = false;
$linky = $this->objFromFixture('SiteTree', 'linky');
$svp = new SubsitesVirtualPage();
$svp->CopyContentFromID = $linky->ID;
$svp->SubsiteID = $subsite->ID;
$svp->URLSegment = 'linky';
$svp->write();
$this->assertEquals($svp->SubsiteID, $subsite->ID);
$this->assertEquals($svp->Title, $linky->Title);
}
}