From d1dcee0d9ee506c4030c89eb2b0601f597bd8b62 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 11 Sep 2020 13:56:51 +0200 Subject: [PATCH] run travis in xenial where possible for latest php versions. Fix unit tests from freakingo over inconsistent error messages in php8-beta. --- .travis.yml | 10 +++++----- CHANGELOG.md | 1 + .../UndefinedTemplateVar/UndefinedTemplateVarTest.php | 8 +------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd03b40e..728452f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: php - -sudo: false - -dist: trusty +os: linux +dist: xenial install: - travis_retry composer require phpunit/phpunit:^7.5 @@ -13,8 +11,10 @@ jobs: dist: precise # PHP 5.3 is supported only on Precise. install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.4 + dist: trusty # PHP 5.4 is supported only on Trusty. install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.5 + dist: trusty # PHP 5.5 is supported only on Trusty. install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.6 install: travis_retry composer require phpunit/phpunit:^5.7 @@ -28,7 +28,7 @@ jobs: install: travis_retry composer config platform.php 7.4.0 && composer require phpunit/phpunit:^7.5 fast_finish: true allow_failures: - - php: nightly + - php: nightly # PHP 8 is still in beta services: - memcached diff --git a/CHANGELOG.md b/CHANGELOG.md index 00dd5d9d..27702e35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed error handlers and handling of undefined constants for php8-compatibility (set $errcontext argument optional) https://github.com/smarty-php/smarty/issues/605 - Changed expected error levels in unit tests for php8-compatibility - Travis unit tests now run for all php versions >= 5.3, including php8 +- Travis runs on Xenial where possible ### Fixed - PHP5.3 compatibility fixes diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php index 64fb9c00..289e73e6 100644 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php +++ b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php @@ -76,13 +76,7 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty } catch (Exception $e) { $exceptionThrown = true; - - if (PHP_VERSION_ID >= 80000) { - $this->assertStringStartsWith('Undefined array key', $e->getMessage()); - } else { - $this->assertStringStartsWith('Undefined index', $e->getMessage()); - } - + $this->assertStringStartsWith('Undefined ', $e->getMessage()); $this->assertTrue(in_array( get_class($e), array(