Making it compatible with Moodle 32+.

This commit is contained in:
Daniel Thee Roperto
2017-09-06 11:46:03 +10:00
parent 73eb442117
commit 249f7cb78b
4 changed files with 34 additions and 6 deletions

View File

@@ -63,4 +63,15 @@ abstract class auth_outage_base_testcase extends advanced_testcase {
}
}
}
public function setUp() {
global $CFG;
parent::setUp();
$this->resetAfterTest(true);
// Do not use https.
$CFG->wwwroot = 'http://www.example.com/moodle';
$CFG->httpswwwroot = $CFG->wwwroot;
}
}

View File

@@ -52,7 +52,6 @@ abstract class auth_outage_cli_testcase extends auth_outage_base_testcase {
\core\session\manager::gc(); // Remove stale sessions.
core_plugin_manager::reset_caches();
$this->resetAfterTest(true);
$this->set_parameters([]);
parent::setUp();
}

View File

@@ -24,7 +24,6 @@
*/
use auth_outage\dml\outagedb;
use auth_outage\local\controllers\infopage;
use auth_outage\local\outage;
use auth_outage\local\outagelib;
@@ -106,6 +105,8 @@ class outagelib_test extends advanced_testcase {
$size = strlen($CFG->additionalhtmltopofbody);
outagelib::inject();
self::assertSame($size, strlen($CFG->additionalhtmltopofbody));
$this->resetDebugging(); // Function pix_url deprecated in Moodle 33+.
}
/**
@@ -141,6 +142,8 @@ class outagelib_test extends advanced_testcase {
outagelib::reinject();
self::assertContains('<style>', $CFG->additionalhtmltopofbody);
self::assertContains('<script>', $CFG->additionalhtmltopofbody);
$this->resetDebugging(); // Function pix_url deprecated in Moodle 33+.
}
/**
@@ -500,6 +503,8 @@ EOT;
outagelib::reinject();
self::assertNotEmpty($CFG->additionalhtmltopofbody);
$this->resetDebugging(); // Function pix_url deprecated in Moodle 33+.
}
private function create_outage() {