From 85b13455ff4cabeb0be867e6bdc0de68bbe2b0ba Mon Sep 17 00:00:00 2001 From: Bernhard Breytenbach Date: Wed, 18 Apr 2018 07:47:06 +0200 Subject: [PATCH 1/3] Default to PHP versions under active development PHP 7.0 is no longer under active support, and PHP 5.5 has been End of Life since Jul 2016. This commit removes version 5.2 - 5.4, and allows failure on EoL 5.5. It also adds 7.1, 7.2, and nightly, in an attempt to promote newer versions of PHP. --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e9aa3b7..4df436c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,18 +5,18 @@ language: php php: # using major version aliases - # aliased to 5.2.17 - - 5.2 - # aliased to 5.3.29 - - 5.3 - # aliased to a recent 5.4.x version - - 5.4 # aliased to a recent 5.5.x version - 5.5 # aliased to a recent 5.6.x version - 5.6 - # aliased to a recent 7.x version + # aliased to a recent 7.0.x version - 7.0 + # aliased to a recent 7.1.x version + - 7.1 + # aliased to a recent 7.2.x version + - 7.2 + # aliased to a recent nightly build + - nightly # aliased to a recent hhvm version - hhvm @@ -31,7 +31,7 @@ matrix: - php: hhvm env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support) allow_failures: - - php: 7.0 + - php: 5.5 - php: hhvm # execute any number of scripts before the test run, custom env's are available as variables From 502e8a9a14d2def1dc25f8455527c7e04b940dc2 Mon Sep 17 00:00:00 2001 From: Bernhard Breytenbach Date: Wed, 18 Apr 2018 11:40:03 +0200 Subject: [PATCH 2/3] Fix PHPUnit namespace for PHP 7 and above --- Tests/HelloWorldTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/HelloWorldTest.php b/Tests/HelloWorldTest.php index eaab7996..c5cb370d 100644 --- a/Tests/HelloWorldTest.php +++ b/Tests/HelloWorldTest.php @@ -1,6 +1,6 @@ assertEquals('Bar', $helloWorld->what()); } } - From 6277050d8b6afa6c4dc8876ec35d325e01726a8f Mon Sep 17 00:00:00 2001 From: Bernhard Breytenbach Date: Wed, 18 Apr 2018 11:57:31 +0200 Subject: [PATCH 3/3] Add fix for PHPUnit running on PHP 5.5 --- Tests/bootstrap.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php index d1fe4e2b..c2de5fb5 100644 --- a/Tests/bootstrap.php +++ b/Tests/bootstrap.php @@ -2,6 +2,12 @@ function loader($class) { + // Support for pre-PHP 5.6 versions + if ($class === 'PHPUnit\Framework\TestCase') { + class_alias('PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase'); + + return; + } $file = $class . '.php'; if (file_exists($file)) { require $file;