mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
This commit is contained in:
parent
8d04bd6d90
commit
53d51e40ba
@ -45,6 +45,9 @@ SiteTree:
|
||||
about:
|
||||
Title: About
|
||||
SubsiteID: =>Subsite_Template.main
|
||||
linky:
|
||||
Title: Linky
|
||||
SubsiteID: =>Subsite_Template.main
|
||||
staff:
|
||||
Title: Staff
|
||||
ParentID: =>SiteTree.about
|
||||
@ -64,6 +67,7 @@ SiteTree:
|
||||
subsite2_contactus:
|
||||
Title: Contact Us (Subsite 2)
|
||||
SubsiteID: =>Subsite_Template.subsite2
|
||||
|
||||
Group:
|
||||
admin:
|
||||
Title: Admin
|
||||
|
25
tests/SubsitesVirtualPageTest.php
Normal file
25
tests/SubsitesVirtualPageTest.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
class SubsitesVirtualPageTest extends SapphireTest {
|
||||
static $fixture_file = 'subsites/tests/SubsiteTest.yml';
|
||||
|
||||
// Attempt to bring main:linky to subsite2:linky
|
||||
function testVirtualPageFromAnotherSubsite() {
|
||||
$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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user