new approach

This commit is contained in:
Daniel Hensby 2017-09-26 12:24:09 +01:00 committed by Daniel Hensby
parent 7f7fe73b77
commit 2c121e8a07
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9

View File

@ -105,11 +105,6 @@ class FunctionalTest extends SapphireTest implements TestOnly
// Flush user // Flush user
$this->logOut(); $this->logOut();
// Switch to draft site, if necessary
if (static::get_use_draft_site()) {
$this->useDraftSite();
}
// Unprotect the site, tests are running with the assumption it's off. They will enable it on a case-by-case // Unprotect the site, tests are running with the assumption it's off. They will enable it on a case-by-case
// basis. // basis.
BasicAuth::protect_entire_site(false); BasicAuth::protect_entire_site(false);
@ -163,7 +158,7 @@ class FunctionalTest extends SapphireTest implements TestOnly
public function get($url, $session = null, $headers = null, $cookies = null) public function get($url, $session = null, $headers = null, $cookies = null)
{ {
$this->cssParser = null; $this->cssParser = null;
if (Versioned::get_stage() === Versioned::DRAFT) { if (self::get_use_draft_site()) {
$url = HTTP::setGetVar('stage', Versioned::DRAFT, $url); $url = HTTP::setGetVar('stage', Versioned::DRAFT, $url);
} }
$response = $this->mainSession->get($url, $session, $headers, $cookies); $response = $this->mainSession->get($url, $session, $headers, $cookies);