From 3639883d30c8aca865067c761cdf4b82b9c9d65e Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 5 Oct 2018 12:02:24 +1300 Subject: [PATCH] Don't use curl when running behat tests to get page outage. Behat step improvements. --- classes/local/controllers/maintenance_static_page.php | 2 +- tests/behat/warningbar.feature | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/local/controllers/maintenance_static_page.php b/classes/local/controllers/maintenance_static_page.php index 0935257..fbd65d0 100644 --- a/classes/local/controllers/maintenance_static_page.php +++ b/classes/local/controllers/maintenance_static_page.php @@ -57,7 +57,7 @@ class maintenance_static_page { if (is_null($outage)) { $html = null; - } else if (PHPUNIT_TEST) { + } else if (PHPUNIT_TEST || BEHAT_SITE_RUNNING) { $html = ''; } else { $data = maintenance_static_page_io::file_get_data( diff --git a/tests/behat/warningbar.feature b/tests/behat/warningbar.feature index 56ebb0e..c9f3ed0 100644 --- a/tests/behat/warningbar.feature +++ b/tests/behat/warningbar.feature @@ -14,7 +14,7 @@ Feature: Warning bar Background: Given the authentication plugin "outage" is enabled - Scenario: This is how an outage should happend without maintenance mode and manual finish. + Scenario: This is how an outage should happen without maintenance mode and manual finish. Given there is the following outage: | warnbefore | startsin | stopsafter | | 10 | 20 | 10 | @@ -24,6 +24,7 @@ Feature: Warning bar And I reload the page Then I should see "Shutting down in" in the warning bar When I wait until the outage starts + And I reload the page Then I should see "Back online at" in the warning bar When I wait until the outage stops Then I should see "We are back online!" in the warning bar