From 6f65ff9199ed01385f849812eeb32c2665b50c69 Mon Sep 17 00:00:00 2001 From: Nicholas Hoobin Date: Mon, 6 Jul 2020 14:20:51 +1000 Subject: [PATCH 1/2] Issue #201: Resolve unit test failures with PHP7.4 --- classes/local/controllers/maintenance_static_page_generator.php | 2 +- classes/local/controllers/maintenance_static_page_io.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/local/controllers/maintenance_static_page_generator.php b/classes/local/controllers/maintenance_static_page_generator.php index d58e87b..986750a 100644 --- a/classes/local/controllers/maintenance_static_page_generator.php +++ b/classes/local/controllers/maintenance_static_page_generator.php @@ -128,7 +128,7 @@ class maintenance_static_page_generator { continue; } $saved = $this->io->save_url_file($href); - if (is_null($saved['url'])) { + if (empty($saved['url'])) { $url = $href; // Skipped, use original URL. } else { $this->update_link_stylesheet_parse($saved['file'], dirname($href)); diff --git a/classes/local/controllers/maintenance_static_page_io.php b/classes/local/controllers/maintenance_static_page_io.php index a5dbb40..eeafb53 100644 --- a/classes/local/controllers/maintenance_static_page_io.php +++ b/classes/local/controllers/maintenance_static_page_io.php @@ -213,7 +213,7 @@ class maintenance_static_page_io { /** * Saves the content of the URL into a file, returning the local filename. * @param string $url Input URL. - * @return string|null Output filename or null if skipped. + * @return array|null Output an array with the filename and url or null if skipped. */ public function save_url_file($url) { global $CFG; From c4f9945c219afe8868659329cf9c2a3c0ef0ea85 Mon Sep 17 00:00:00 2001 From: Nicholas Hoobin Date: Mon, 6 Jul 2020 16:40:04 +1000 Subject: [PATCH 2/2] Issue #201: Update travis to check against PHP7.4 Travis, PGSQL 9.5. Default distro. PHP 7.4 check added on M39/master. --- .travis.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c13e5f7..b2023cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,16 @@ language: php sudo: true +services: + - mysql + addons: firefox: "47.0.1" - postgresql: "9.4" + postgresql: "9.5" apt: packages: - openjdk-8-jre -dist: trusty - cache: directories: - $HOME/.composer/cache @@ -26,8 +27,6 @@ env: - DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE - DB=pgsql MOODLE_BRANCH=MOODLE_39_STABLE - DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE - - DB=pgsql MOODLE_BRANCH=master - - DB=mysqli MOODLE_BRANCH=master matrix: include: @@ -37,13 +36,13 @@ matrix: env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE - php: 7.1 env: DB=mysqli MOODLE_BRANCH=MOODLE_33_STABLE NODEJS=8 + - php: 7.4 + env: DB=mysqli MOODLE_BRANCH=master + - php: 7.4 + env: DB=pgsql MOODLE_BRANCH=master before_install: - export MOODLE_VERSION=$(echo "$MOODLE_BRANCH" | cut -d'_' -f 2) - - if [ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ] && [ $DB == "pgsql" ] && [[ "$MOODLE_VERSION" -gt 38 || "$MOODLE_VERSION" == "master" ]] ; then - sudo /etc/init.d/postgresql stop; - sudo /etc/init.d/postgresql start 9.5; - fi - phpenv config-rm xdebug.ini - if [ "$NODEJS" = 8 ]; then nvm install 8.9;