mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-17 05:48:43 +02:00
Compare commits
17 Commits
ci-testing
...
TOTARA_19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f45918a277 | ||
|
|
478d0fc5c1 | ||
|
|
ca4a202752 | ||
|
|
25b9e553a5 | ||
|
|
5cc215d819 | ||
|
|
e8c00be2dd | ||
|
|
ca213e4c04 | ||
|
|
eac1575f51 | ||
|
|
cff0f3fbe3 | ||
|
|
ffb9e27456 | ||
|
|
f842e2baa4 | ||
|
|
f3d91cb044 | ||
|
|
a63ffed1bc | ||
|
|
c99d8f12a0 | ||
|
|
d3b5ed73aa | ||
|
|
03362c084c | ||
|
|
51db933862 |
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -8,4 +8,5 @@ jobs:
|
||||
uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main
|
||||
secrets:
|
||||
moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }}
|
||||
|
||||
with:
|
||||
disable_behat: true
|
||||
|
||||
@@ -57,7 +57,7 @@ class outagelib {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir . '/filelib.php');
|
||||
|
||||
$curl = new curl();
|
||||
$curl = new curl(['ignoresecurity' => true]);
|
||||
$contents = $curl->get($file);
|
||||
$info = $curl->get_info();
|
||||
if (!empty($info['content_type'])) {
|
||||
@@ -266,7 +266,7 @@ class outagelib {
|
||||
|
||||
// Used to test the try block in case of errors.
|
||||
if (PHPUNIT_TEST && optional_param('auth_outage_break_code', false, PARAM_INT)) {
|
||||
(new stdClass())->invalidfield; // Triggers an exception.
|
||||
throw new coding_exception('Exception triggered');
|
||||
}
|
||||
|
||||
// Nothing preventing the injection.
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_outage;
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
|
||||
@@ -35,7 +33,7 @@ use auth_outage\local\outage;
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class base_testcase extends \advanced_testcase {
|
||||
abstract class base_testcase extends \core_phpunit\testcase {
|
||||
/**
|
||||
* Checks PHPUnit version and calls the functions accordingly.
|
||||
* @param string $exception Expected exception class.
|
||||
@@ -107,5 +105,6 @@ abstract class base_testcase extends \advanced_testcase {
|
||||
foreach (outagedb::get_all() as $i => $outage) {
|
||||
$DB->delete_records('auth_outage', ['id' => $outage->id]);
|
||||
}
|
||||
parent::tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\calendar;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\calendar\calendar;
|
||||
|
||||
/**
|
||||
* calendar_test test class.
|
||||
@@ -39,7 +38,7 @@ use auth_outage\local\outage;
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\calendar\calendar
|
||||
*/
|
||||
class calendar_test extends \advanced_testcase {
|
||||
class calendar_test extends \core_phpunit\testcase {
|
||||
/**
|
||||
* @var outage|null The calendar entry owner.
|
||||
*/
|
||||
@@ -23,10 +23,10 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\cli;
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\local\cli\create;
|
||||
use auth_outage\local\cli\cli_exception;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/cli_testcase.php');
|
||||
@@ -40,7 +40,12 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\cli\create
|
||||
*/
|
||||
class create_test extends cli_testcase {
|
||||
class cli_create_test extends cli_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests without any arguments.
|
||||
*/
|
||||
@@ -23,10 +23,10 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\cli;
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\local\cli\finish;
|
||||
use auth_outage\local\cli\cli_exception;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/cli_testcase.php');
|
||||
@@ -40,7 +40,12 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\cli\finish
|
||||
*/
|
||||
class finish_test extends cli_testcase {
|
||||
class cli_finish_test extends cli_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the constructor.
|
||||
*/
|
||||
@@ -23,7 +23,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\cli;
|
||||
use auth_outage\local\cli\cli_exception;
|
||||
use auth_outage\local\cli\create;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/cli_testcase.php');
|
||||
@@ -38,6 +39,11 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @covers \auth_outage\local\cli\create
|
||||
*/
|
||||
class cli_test extends cli_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests providing an unknown parameter.
|
||||
*/
|
||||
@@ -23,10 +23,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\cli;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* cli_testcase class.
|
||||
@@ -36,7 +34,12 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @copyright 2016 Catalyst IT
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
abstract class cli_testcase extends \auth_outage\base_testcase {
|
||||
abstract class cli_testcase extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Always enable the auth outage plugin, resets after test and set no parameters.
|
||||
*/
|
||||
@@ -73,7 +76,7 @@ abstract class cli_testcase extends \auth_outage\base_testcase {
|
||||
*
|
||||
* @return string The output text.
|
||||
*/
|
||||
protected function execute(clibase $cli) {
|
||||
protected function execute(mixed $cli) {
|
||||
ob_start();
|
||||
try {
|
||||
$cli->execute();
|
||||
@@ -23,10 +23,10 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\cli;
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\local\cli\waitforit;
|
||||
use auth_outage\local\cli\cli_exception;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/cli_testcase.php');
|
||||
@@ -40,7 +40,12 @@ require_once(__DIR__.'/cli_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\cli\waitforit
|
||||
*/
|
||||
class waitforit_test extends cli_testcase {
|
||||
class cli_waitforit_test extends cli_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the constructor.
|
||||
*/
|
||||
@@ -23,13 +23,11 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\controllers;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use context_system;
|
||||
use auth_outage\local\controllers\infopage;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* Tests performed on infopage controller class and update_static_page task class.
|
||||
@@ -40,7 +38,12 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\controllers\infopage
|
||||
*/
|
||||
class infopage_test extends \auth_outage\base_testcase {
|
||||
class controllers_infopage_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the constructor.
|
||||
*/
|
||||
@@ -23,13 +23,13 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\local\controllers;
|
||||
|
||||
use auth_outage\task\update_static_page;
|
||||
use DOMDocument;
|
||||
use auth_outage\local\controllers\maintenance_static_page;
|
||||
use auth_outage\local\controllers\maintenance_static_page_io;
|
||||
use auth_outage\local\controllers\maintenance_static_page_generator;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* maintenance_static_page_test class.
|
||||
@@ -40,7 +40,12 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\controllers\maintenance_static_page_generator
|
||||
*/
|
||||
class maintenance_static_page_test extends \auth_outage\base_testcase {
|
||||
class controllers_maintenance_static_page_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test template file.
|
||||
*/
|
||||
@@ -122,7 +127,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase {
|
||||
$page->generate();
|
||||
|
||||
// Check for css file.
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/53365950336b070c0b26ca50e7d0dad962c364e6.dGV4dC9wbGFpbg');
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/b09bd4b66cc3964d5fc5978752fc554f5666daa3.dGV4dC9wbGFpbg');
|
||||
|
||||
// Check for catalyst.png file referenced in url(..) of css.
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/ff7f7f87a26a908fc72930eaefb6b57306361d16.aW1hZ2UvcG5n');
|
||||
@@ -140,7 +145,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase {
|
||||
$page->generate();
|
||||
|
||||
// Check for css file.
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/e0b34925c1f939c247a4b50d6bf08c76088def39.dGV4dC9wbGFpbg');
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/2ec04228cc8bb37782f511aaeb01ee553cc884a4.dGV4dC9wbGFpbg');
|
||||
|
||||
// Check for catalyst.png file referenced in url(..) of css.
|
||||
self::assertFileExists($page->get_io()->get_resources_folder().'/ff7f7f87a26a908fc72930eaefb6b57306361d16.aW1hZ2UvcG5n');
|
||||
@@ -338,7 +343,7 @@ class maintenance_static_page_test extends \auth_outage\base_testcase {
|
||||
* @return string
|
||||
*/
|
||||
private function get_fixture_path_location($file) {
|
||||
return (string)new \moodle_url('/auth/outage/tests/local/controllers/fixtures/'.$file);
|
||||
return (string)new \moodle_url('/auth/outage/tests/fixtures/'.$file);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -423,6 +428,37 @@ class maintenance_static_page_test extends \auth_outage\base_testcase {
|
||||
maintenance_static_page_io::file_get_data(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test file_get_data with curlsecurityblockedhosts.
|
||||
* We will use an external URL to test passing ignoresecurity inside of file_get_data works,
|
||||
* ideally in real code we should only be calling file_get_data with internal URLs.
|
||||
*/
|
||||
public function test_file_get_data_curlsecurityblockedhosts() {
|
||||
global $CFG, $USER;
|
||||
|
||||
$testhtml = $this->getExternalTestFileUrl('/test.html');
|
||||
$url = new \moodle_url($testhtml);
|
||||
$host = $url->get_host();
|
||||
set_config('curlsecurityblockedhosts', $host); // Blocks $host.
|
||||
|
||||
// Test a regular curl with the default security enabled does in fact get blocked.
|
||||
$curl = new \curl();
|
||||
$contents = $curl->get($testhtml);
|
||||
$expected = $curl->get_security()->get_blocked_url_string();
|
||||
self::assertSame($expected, $contents);
|
||||
self::assertSame(0, $curl->get_errno());
|
||||
if ($CFG->branch >= 403) {
|
||||
self::assertDebuggingCalled(
|
||||
"Blocked $testhtml: The URL is blocked. [user {$USER->id}]", DEBUG_NONE);
|
||||
}
|
||||
|
||||
// Test file_get_data does return the page and isn't blocked by security.
|
||||
$found = maintenance_static_page_io::file_get_data($url->out());
|
||||
$expected = '47250a973d1b88d9445f94db4ef2c97a';
|
||||
self::assertSame($expected, md5($found['contents']));
|
||||
self::assertSame('text/html', $found['mime']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test remove css selector.
|
||||
*/
|
||||
@@ -23,9 +23,8 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\dml;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\dml\outagedb;
|
||||
|
||||
/**
|
||||
* events_test tests class.
|
||||
@@ -39,7 +38,7 @@ use auth_outage\local\outage;
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\dml\outagedb
|
||||
*/
|
||||
class events_test extends \advanced_testcase {
|
||||
class dml_events_test extends \core_phpunit\testcase {
|
||||
/**
|
||||
* @var outage|null Outage used in the tests.
|
||||
*/
|
||||
@@ -25,12 +25,11 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\dml;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\dml\outagedb;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* installation_test test class.
|
||||
@@ -43,7 +42,12 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\dml\outagedb
|
||||
*/
|
||||
class installation_test extends \auth_outage\base_testcase {
|
||||
class dml_installation_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if plugin cleans up data after uninstall.
|
||||
*
|
||||
@@ -23,12 +23,11 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\dml;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\dml\outagedb;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* outagedb_test tests class.
|
||||
@@ -39,7 +38,12 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\dml\outagedb
|
||||
*/
|
||||
class outagedb_test extends \auth_outage\base_testcase {
|
||||
class dml_outagedb_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of ids in from the given outages array.
|
||||
* @param outage[] $outages An array of outages.
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
7
tests/fixtures/withurls-quoted.css
vendored
Normal file
7
tests/fixtures/withurls-quoted.css
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
a {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
div {
|
||||
background-image: url('/moodle/auth/outage/tests/fixtures/catalyst.png');
|
||||
}
|
||||
7
tests/fixtures/withurls.css
vendored
Normal file
7
tests/fixtures/withurls.css
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
a {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
div {
|
||||
background-image: url(/moodle/auth/outage/tests/fixtures/catalyst.png);
|
||||
}
|
||||
@@ -23,12 +23,13 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace auth_outage\form\outage;
|
||||
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\form\outage\delete;
|
||||
use auth_outage\form\outage\finish;
|
||||
use auth_outage\form\outage\edit;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* forms_test test class.
|
||||
@@ -39,7 +40,12 @@ require_once(__DIR__.'/../../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\form\outage\edit
|
||||
*/
|
||||
class forms_test extends \auth_outage\base_testcase {
|
||||
class forms_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a delete form.
|
||||
*/
|
||||
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_outage;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
require_once(__DIR__.'/../lib.php');
|
||||
@@ -29,7 +27,7 @@ require_once(__DIR__.'/../lib.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers ::auth_outage_get_climaintenance_resource_file
|
||||
*/
|
||||
class lib_test extends base_testcase {
|
||||
class lib_test extends \core_phpunit\testcase {
|
||||
/**
|
||||
* Test this plugin gets climaintenance resource file.
|
||||
*/
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
a {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
div {
|
||||
background-image: url('/moodle/auth/outage/tests/local/controllers/fixtures/catalyst.png');
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
a {
|
||||
font-size: 200%;
|
||||
}
|
||||
|
||||
div {
|
||||
background-image: url(/moodle/auth/outage/tests/local/controllers/fixtures/catalyst.png);
|
||||
}
|
||||
@@ -14,10 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_outage\local;
|
||||
use auth_outage\local\outage;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
require_once(__DIR__.'/../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* outage_test test class.
|
||||
@@ -28,7 +28,12 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\outage
|
||||
*/
|
||||
class outage_test extends \auth_outage\base_testcase {
|
||||
class outage_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the constructor.
|
||||
*/
|
||||
@@ -14,14 +14,14 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace auth_outage\local;
|
||||
|
||||
use auth_outage\dml\outagedb;
|
||||
use auth_outage\local\outage;
|
||||
use auth_outage\local\outagelib;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
require_once(__DIR__.'/../base_testcase.php');
|
||||
require_once(__DIR__.'/base_testcase.php');
|
||||
|
||||
/**
|
||||
* outagelib_test test class.
|
||||
@@ -32,7 +32,12 @@ require_once(__DIR__.'/../base_testcase.php');
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @covers \auth_outage\local\outagelib
|
||||
*/
|
||||
class outagelib_test extends \auth_outage\base_testcase {
|
||||
class outagelib_test extends base_testcase {
|
||||
|
||||
public function tearDown(): void {
|
||||
parent::tearDown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if maintenance message is disabled as needed.
|
||||
*/
|
||||
@@ -742,7 +747,7 @@ EOT;
|
||||
*
|
||||
* We need this because we modify the request headers,
|
||||
* see https://github.com/sebastianbergmann/phpunit/issues/720#issuecomment-10421092
|
||||
* @runInSeparateProcess
|
||||
* @runClassInSeparateProcess
|
||||
*/
|
||||
public function test_evaluation_maintenancepage(?string $allowedips, ?string $iptouse, ?string $accesskey,
|
||||
?string $accesskeytouse, array $expectedoutputs) {
|
||||
Reference in New Issue
Block a user