From d6117630bdc3be78f6426cf672cda6e68762a4ba Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 2 Oct 2018 12:55:49 +1300 Subject: [PATCH 1/2] FIX: Stricter regex syntax for PHP7.3 support. --- core/TempPath.php | 2 +- tests/core/CoreTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/TempPath.php b/core/TempPath.php index 4f3a94c85..0bc6645e5 100644 --- a/core/TempPath.php +++ b/core/TempPath.php @@ -12,7 +12,7 @@ function getTempFolder($base = null) { $parent = getTempParentFolder($base); // The actual temp folder is a subfolder of getTempParentFolder(), named by username and suffixed with currently used php-version - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); $subfolder = $parent . DIRECTORY_SEPARATOR . getTempFolderUsername() . $phpversion; if(!@file_exists($subfolder)) { diff --git a/tests/core/CoreTest.php b/tests/core/CoreTest.php index 5b4cc7510..06c716255 100644 --- a/tests/core/CoreTest.php +++ b/tests/core/CoreTest.php @@ -17,7 +17,7 @@ class CoreTest extends SapphireTest { public function testGetTempPathInProject() { $user = getTempFolderUsername(); - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); if(file_exists($this->tempPath)) { $this->assertEquals(getTempFolder(BASE_PATH), $this->tempPath . DIRECTORY_SEPARATOR . $user . $phpversion); } else { @@ -43,9 +43,9 @@ class CoreTest extends SapphireTest { public function tearDown() { parent::tearDown(); $user = getTempFolderUsername(); - $phpversion = '-php' . preg_replace('/[^\w-\.+]+/', '-', PHP_VERSION); + $phpversion = '-php' . preg_replace('/[^\w\-\.+]+/', '-', PHP_VERSION); $base = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'silverstripe-cache' . $phpversion; - + foreach(array( 'C--inetpub-wwwroot-silverstripe-test-project', '-Users-joebloggs-Sites-silverstripe-test-project', From 518b6514cdda6496b59dcaac9020c331d03d6714 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 25 Sep 2018 16:25:30 +1200 Subject: [PATCH 2/2] NEW: Add test for PHP 7.3 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also added a SQLite 7.1 test as it’s very fast now, reordered the tests with some commentary, and pushed the PGSQL test to 5.4 as they are both “edge-cases” Note that MySQL test speed is very problematic and has been addressed in https://github.com/silverstripe/silverstripe-framework/pull/8435 --- .travis.yml | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8ca708fe..370a74860 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,22 +8,50 @@ addons: apt: packages: - tidy - firefox: "31.0" matrix: include: + # Framework tests - php: 5.4 - env: DB=MYSQL PDO=1 + env: DB=PGSQL + services: + - postgresql + - php: 7.0 env: DB=SQLITE + + - php: 7.1 + env: DB=SQLITE + - php: 7.2 - env: DB=PGSQL - - php: 5.6 - env: DB=MYSQL BEHAT_TEST=1 + env: DB=MYSQL PDO=1 + services: + - mysql + + - php: 7.3.0RC1 + env: DB=SQLITE + sudo: required + dist: xenial + addons: + apt: + packages: + - libzip4 + + # CMS test - php: 5.5 env: DB=MYSQL CMS_TEST=1 + services: + - mysql + + # Behat tests + - php: 5.6 + env: DB=MYSQL BEHAT_TEST=1 + addons: + firefox: "31.0" - php: 7.1 env: DB=MYSQL BEHAT_TEST=1 CMS_TEST=1 + addons: + firefox: "31.0" before_script: # Fix bug in Selenium with duplicate localhost definitions: https://github.com/travis-ci/travis-ci/issues/3054 @@ -34,7 +62,7 @@ before_script: - if [ $(phpenv version-name) = "5.3" ]; then printf "\n" | travis_retry pecl install imagick-3.3.0; fi - composer self-update || true - phpenv rehash - - phpenv config-rm xdebug.ini + - phpenv config-rm xdebug.ini || true - echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support - "if [ \"$BEHAT_TEST\" = \"\" ] && [ \"$CMS_TEST\" = \"\" ]; then php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss; fi"