Merge pull request #14 from catalyst/issue13-moodle32

Issue #13 - Updated Travis and unit test.
This commit is contained in:
Daniel Thee Roperto 2017-05-15 12:04:04 +10:00 committed by GitHub
commit c335cee4f9
2 changed files with 24 additions and 29 deletions

View file

@ -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:
matrix: global:
- DB=pgsql MOODLE_BRANCH=MOODLE_29_STABLE - DB=pgsql # There is not enough database usage to justify full check with mysqli too.
- DB=pgsql MOODLE_BRANCH=MOODLE_30_STABLE matrix:
- DB=pgsql MOODLE_BRANCH=MOODLE_31_STABLE - MOODLE_BRANCH=MOODLE_30_STABLE
- DB=pgsql MOODLE_BRANCH=master - MOODLE_BRANCH=MOODLE_31_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_29_STABLE - MOODLE_BRANCH=MOODLE_32_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_30_STABLE - MOODLE_BRANCH=MOODLE_33_STABLE
- DB=mysqli MOODLE_BRANCH=MOODLE_31_STABLE - MOODLE_BRANCH=master
- 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
@ -56,4 +50,4 @@ script:
- moodle-plugin-ci shifter - moodle-plugin-ci shifter
- moodle-plugin-ci jshint - moodle-plugin-ci jshint
- moodle-plugin-ci phpunit - moodle-plugin-ci phpunit
- moodle-plugin-ci behat - moodle-plugin-ci behat

View file

@ -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();
} }