mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
c5bf8a31cb
commit
3191f4d46a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user