tests/SubsitesVirtualPageTest.php
/**
	 * Test custom metadata. Reloading Content should not
	 * obliterate our custom fields
	 */
Test custom metadata. Reloading Content should not
obliterate our custom fields
Test custom metadata . Reloading Content should not obliterate our custom fields
function testCustomMetadata() {
		Subsite::$write_hostmap = false;
		$subsite = $this->objFromFixture('Subsite_Template', 'main');
		Subsite::changeSubsite($subsite->ID);
		$orig = $this->objFromFixture('SiteTree', 'linky');
		$svp = new SubsitesVirtualPage();
		$svp->CopyContentFromID = $orig->ID;
		$svp->SubsiteID = $subsite->ID;
		$svp->URLSegment = 'linky-'.rand();
		$svp->write();
		$this->assertEquals($svp->MetaTitle, 'Linky');
		$svp->CustomMetaTitle = 'SVPTitle';
		$svp->write();
		$this->assertEquals($svp->MetaTitle, 'SVPTitle');
		$svp->copyFrom($svp->CopyContentFrom());
		$svp->write();
		$this->assertEquals($svp->MetaTitle, 'SVPTitle');
	}
function testCustomMetadata ( ) { Subsite :: $ write_hostmap = false ; $ subsite = $ this -> objFromFixture ( 'Subsite_Template' , 'main' ) ; Subsite :: changeSubsite ( $ subsite -> ID ) ; $ orig = $ this -> objFromFixture ( 'SiteTree' , 'linky' ) ; $ svp = new SubsitesVirtualPage ( ) ; $ svp -> CopyContentFromID = $ orig -> ID ; $ svp -> SubsiteID = $ subsite -> ID ; $ svp -> URLSegment = 'linky-' . rand ( ) ; $ svp -> write ( ) ; $ this -> assertEquals ( $ svp -> MetaTitle , 'Linky' ) ; $ svp -> CustomMetaTitle = 'SVPTitle' ; $ svp -> write ( ) ; $ this -> assertEquals ( $ svp -> MetaTitle , 'SVPTitle' ) ; $ svp -> copyFrom ( $ svp -> CopyContentFrom ( ) ) ; $ svp -> write ( ) ; $ this -> assertEquals ( $ svp -> MetaTitle , 'SVPTitle' ) ; }
Test custom metadata.
Test custom metadata .