Added test for SiteTree::publish

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40233 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2007-08-16 06:36:39 +00:00
parent 188526a9de
commit d595057533

View File

@ -27,4 +27,24 @@ class SiteTreeTest extends SapphireTest {
$this->assertEquals($urlSegment, $obj->URLSegment);
}
}
/**
* Test that publication copies data to SiteTree_Live
*/
function testPublishCopiesToLiveTable() {
$obj = $this->objFromFixture('Page','about');
$obj->publish('Stage', 'Live');
$createdID = DB::query("SELECT ID FROM SiteTree_Live WHERE URLSegment = '$obj->URLSegment'")->value();
$this->assertEquals($obj->ID, $createdID);
}
/**
* Test that saving changes creates a new version with the correct data in it.
*/
/**
* Test that publishing an unsaved page will save the changes before publishing
*/
}