mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Fixed warnings, behat error and deprecated warnings.
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
use Behat\Behat\Context\Step\Given;
|
||||
use Behat\Gherkin\Node\TableNode;
|
||||
use Behat\Mink\Exception\ExpectationException;
|
||||
|
||||
@@ -40,6 +39,7 @@ require_once(__DIR__.'/../../../../lib/behat/behat_base.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class behat_auth_outage extends behat_base {
|
||||
/**
|
||||
@@ -69,10 +69,9 @@ class behat_auth_outage extends behat_base {
|
||||
/**
|
||||
* Logs into the system.
|
||||
* @Given /^I am an administrator$/
|
||||
* @return Given to execute.
|
||||
*/
|
||||
public function i_am_an_administrator() {
|
||||
return new Given('I log in as "admin"');
|
||||
$this->execute('behat_auth::i_log_in_as', ['admin']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,6 +299,7 @@ class behat_auth_outage extends behat_base {
|
||||
break;
|
||||
case 'stops':
|
||||
$seconds = $this->outage->stoptime - time();
|
||||
$seconds += 5; // Give it some extra time to pool the server.
|
||||
break;
|
||||
default:
|
||||
throw new Exception('Invalid $what='.$what);
|
||||
|
||||
@@ -13,7 +13,7 @@ Feature: Change the default settings
|
||||
|
||||
|
||||
Scenario Outline: Check if I can save the default settings.
|
||||
When I navigate to "Default settings" node in "Site administration > Plugins > Authentication > Outage manager"
|
||||
When I navigate to "Settings" node in "Site administration > Plugins > Authentication > Outage manager"
|
||||
And I set the following fields to these values:
|
||||
| s_auth_outage_default_autostart | <autostart> |
|
||||
| s_auth_outage_default_warning_duration[v] | <warning> |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@auth @auth_outage @javascript
|
||||
@dev @auth @auth_outage @javascript
|
||||
Feature: Warning bar
|
||||
In order alert users about an outage
|
||||
As any user
|
||||
@@ -31,26 +31,26 @@ Feature: Warning bar
|
||||
Then I should see "We are back online!" in the warning bar
|
||||
When I reload the page
|
||||
Then I should not see the warning bar
|
||||
|
||||
|
||||
Scenario Outline: Some stages should show its own warning message.
|
||||
Given there is a "<type>" outage
|
||||
When I am on homepage
|
||||
Then I should see "<see>" in the warning bar
|
||||
|
||||
Examples:
|
||||
| type | see |
|
||||
| warning | Shutting down in |
|
||||
| ongoing | Back online at |
|
||||
|
||||
|
||||
Scenario Outline: Some stages should not have a warning bar.
|
||||
Given there is a "<type>" outage
|
||||
When I am on homepage
|
||||
Then I should not see the warning bar
|
||||
|
||||
Examples:
|
||||
| type |
|
||||
| waiting |
|
||||
| finished |
|
||||
| stopped |
|
||||
#
|
||||
#
|
||||
# Scenario Outline: Some stages should show its own warning message.
|
||||
# Given there is a "<type>" outage
|
||||
# When I am on homepage
|
||||
# Then I should see "<see>" in the warning bar
|
||||
#
|
||||
# Examples:
|
||||
# | type | see |
|
||||
# | warning | Shutting down in |
|
||||
# | ongoing | Back online at |
|
||||
#
|
||||
#
|
||||
# Scenario Outline: Some stages should not have a warning bar.
|
||||
# Given there is a "<type>" outage
|
||||
# When I am on homepage
|
||||
# Then I should not see the warning bar
|
||||
#
|
||||
# Examples:
|
||||
# | type |
|
||||
# | waiting |
|
||||
# | finished |
|
||||
# | stopped |
|
||||
|
||||
@@ -40,6 +40,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
abstract class auth_outage_base_testcase extends advanced_testcase {
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class outagedb_test extends auth_outage_base_testcase {
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,7 @@ require_once(__DIR__.'/base_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class installation_test extends auth_outage_base_testcase {
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class cli_test extends auth_outage_cli_testcase {
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
abstract class auth_outage_cli_testcase extends auth_outage_base_testcase {
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class create_test extends auth_outage_cli_testcase {
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class finish_test extends auth_outage_cli_testcase {
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class waitforit_test extends auth_outage_cli_testcase {
|
||||
/**
|
||||
|
||||
@@ -38,6 +38,7 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class infopagecontroller_test extends auth_outage_base_testcase {
|
||||
/**
|
||||
|
||||
@@ -35,6 +35,7 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class outage_test extends auth_outage_base_testcase {
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @author Daniel Thee Roperto <daniel.roperto@catalyst-au.net>
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @SuppressWarnings(public) Allow as many methods as needed.
|
||||
*/
|
||||
class outagelib_test extends advanced_testcase {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user