Issue #13 - Updated Travis and unit test.
- Added Moodle 32 and Moodle 33 to Travis. - Updated Travis to not test mysql in every scenario - Updated Travis to use Postgres 9.3 (required by Moodle 33+) - Updated test_that_user_logged_in_and_redirected as newer Moodle defaults to different URL.
This commit is contained in:
parent
9ec87b0e87
commit
596f2d72aa
2 changed files with 24 additions and 29 deletions
44
.travis.yml
44
.travis.yml
|
@ -1,43 +1,37 @@
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
recipients:
|
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.composer/cache
|
- $HOME/.composer/cache
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- 5.6
|
- 5.6
|
||||||
|
- 7.0
|
||||||
|
|
||||||
|
addons:
|
||||||
|
postgresql: "9.3"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
global:
|
||||||
|
- DB=pgsql # There is not enough database usage to justify full check with mysqli too.
|
||||||
matrix:
|
matrix:
|
||||||
- DB=pgsql MOODLE_BRANCH=MOODLE_29_STABLE
|
- MOODLE_BRANCH=MOODLE_30_STABLE
|
||||||
- DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
|
- MOODLE_BRANCH=MOODLE_31_STABLE
|
||||||
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
|
- MOODLE_BRANCH=MOODLE_32_STABLE
|
||||||
- DB=pgsql MOODLE_BRANCH=master
|
- MOODLE_BRANCH=MOODLE_33_STABLE
|
||||||
- DB=mysqli MOODLE_BRANCH=MOODLE_29_STABLE
|
- MOODLE_BRANCH=master
|
||||||
- DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE
|
|
||||||
- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
|
|
||||||
- DB=mysqli MOODLE_BRANCH=master
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- php: 7.0
|
# Test old Moodle in PHP 5.6 only
|
||||||
env: DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE
|
- php: 5.6
|
||||||
- php: 7.0
|
env: MOODLE_BRANCH=MOODLE_29_STABLE
|
||||||
env: DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE
|
# Test MySQL
|
||||||
- php: 7.0
|
|
||||||
env: DB=pgsql MOODLE_BRANCH=master
|
|
||||||
- php: 7.0
|
|
||||||
env: DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE
|
|
||||||
- php: 7.0
|
|
||||||
env: DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE
|
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
env: DB=mysqli MOODLE_BRANCH=master
|
env: DB=mysqli MOODLE_BRANCH=master
|
||||||
|
# Test PHP 7.1
|
||||||
|
- php: 7.1
|
||||||
|
env: MOODLE_BRANCH=master
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- cd ../..
|
- cd ../..
|
||||||
|
@ -46,7 +40,7 @@ before_install:
|
||||||
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- moodle-plugin-ci install
|
- moodle-plugin-ci install -vvv
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- moodle-plugin-ci phplint
|
- moodle-plugin-ci phplint
|
||||||
|
|
|
@ -901,7 +901,7 @@ class auth_plugin_userkey_testcase extends advanced_testcase {
|
||||||
* @expectedExceptionMessage Unsupported redirect to http://www.example.com/moodle detected, execution terminated.
|
* @expectedExceptionMessage Unsupported redirect to http://www.example.com/moodle detected, execution terminated.
|
||||||
*/
|
*/
|
||||||
public function test_that_user_logged_in_and_redirected() {
|
public function test_that_user_logged_in_and_redirected() {
|
||||||
global $DB;
|
global $DB, $CFG;
|
||||||
|
|
||||||
$key = new stdClass();
|
$key = new stdClass();
|
||||||
$key->value = 'UserLogin';
|
$key->value = 'UserLogin';
|
||||||
|
@ -913,6 +913,7 @@ class auth_plugin_userkey_testcase extends advanced_testcase {
|
||||||
$key->timecreated = time();
|
$key->timecreated = time();
|
||||||
$DB->insert_record('user_private_key', $key);
|
$DB->insert_record('user_private_key', $key);
|
||||||
|
|
||||||
|
$CFG->wwwroot = 'http://www.example.com/moodle';
|
||||||
$_POST['key'] = 'UserLogin';
|
$_POST['key'] = 'UserLogin';
|
||||||
@$this->auth->user_login_userkey();
|
@$this->auth->user_login_userkey();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue