ENHANCEMENT: added the ability to toggle the use draft site setting (from r110757)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112844 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 01:32:17 +00:00
parent 6f8baaa2c9
commit 9107cf950b

View File

@ -279,10 +279,18 @@ 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() {
$this->session()->inst_set('readingMode', 'Stage.Stage');
$this->session()->inst_set('unsecuredDraftSite', true);
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);
}
}
/**