ENHANCEMENT: added the ability to toggle the use draft site setting

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@110757 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Will Rossiter 2010-09-14 22:12:15 +00:00 committed by Sam Minnee
parent c5bf8a31cb
commit 3191f4d46a

View File

@ -279,11 +279,19 @@ class FunctionalTest extends SapphireTest {
/**
* Use the draft (stage) site for testing.
* This is helpful if you're not testing publication functionality and don't want "stage management" cluttering your test.
*
* @param bool toggle the use of the draft site
*/
function useDraftSite() {
function useDraftSite($enabled = true) {
if($enabled) {
$this->session()->inst_set('readingMode', 'Stage.Stage');
$this->session()->inst_set('unsecuredDraftSite', true);
}
else {
$this->session()->inst_set('readingMode', 'Stage.Live');
$this->session()->inst_set('unsecuredDraftSite', false);
}
}
/**
* Return a static variable from this class.