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

@@ -9,15 +9,29 @@ cache:
directories:
- $HOME/.composer/cache
addons:
postgresql: "9.3"
php:
- 5.5
- 7.0
env:
- DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
- DB=pgsql MOODLE_BRANCH=MOODLE_32_STABLE
- DB=pgsql MOODLE_BRANCH=MOODLE_33_STABLE
- DB=pgsql MOODLE_BRANCH=master
- DB=mysqli MOODLE_BRANCH=master
matrix:
include:
- php: 5.5
env: DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
- php: 5.5
env: DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE
- php: 7.1
env: DB=pgsql MOODLE_BRANCH=master
before_install:
- phpenv config-rm xdebug.ini
@@ -39,4 +53,3 @@ script:
- moodle-plugin-ci shifter
- moodle-plugin-ci jshint
- moodle-plugin-ci phpunit
- moodle-plugin-ci behat

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() {