run travis in xenial where possible for latest php versions. Fix unit tests from freakingo over inconsistent error messages in php8-beta.

This commit is contained in:
Simon Wisselink
2020-09-11 13:56:51 +02:00
parent 8df47cf030
commit d1dcee0d9e
3 changed files with 7 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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(