Fix FunctionalTest not setting persistent versioned mode

This commit is contained in:
Damian Mooyman 2018-03-21 16:07:31 +13:00
parent 26402f3bb5
commit ba94e020e7
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -406,15 +406,13 @@ class FunctionalTest extends SapphireTest implements TestOnly
* This is helpful if you're not testing publication functionality and don't want "stage management" cluttering * This is helpful if you're not testing publication functionality and don't want "stage management" cluttering
* your test. * your test.
* *
* @param bool $enabled toggle the use of the draft site * @param bool $draft toggle the use of the draft site
*/ */
public function useDraftSite($enabled = true) public function useDraftSite($draft = true)
{ {
if ($enabled) { $stage = $draft ? Versioned::DRAFT : Versioned::LIVE;
Versioned::set_stage(Versioned::DRAFT); Versioned::set_stage($stage);
} else { Versioned::set_default_reading_mode(Versioned::get_reading_mode());
Versioned::set_stage(Versioned::LIVE);
}
} }
/** /**