diff --git a/.travis.yml b/.travis.yml index 80752e3d..69b76018 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,19 +4,27 @@ sudo: false dist: trusty -matrix: +install: + - travis_retry composer require phpunit/phpunit:^7.5 + +jobs: include: - php: 5.3 # Composer and PHPUnit require PHP 5.3.2+ to run, so we cannot test below 5.3 dist: precise # PHP 5.3 is supported only on Precise. + install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.4 + install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.5 + install: travis_retry composer require phpunit/phpunit:^4.8 - php: 5.6 + install: travis_retry composer require phpunit/phpunit:^5.7 - php: 7.0 + install: travis_retry composer require phpunit/phpunit:^6.5 - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4 - - php: nightly # PHP nightly build testing disabled because PHPUnit doesn't support PHP8 yet. + - php: nightly fast_finish: true allow_failures: - php: nightly @@ -31,8 +39,5 @@ before_script: before_install: - phpenv config-rm xdebug.ini || return 0 -install: - - travis_retry composer install - script: - ./phpunit.sh diff --git a/composer.json b/composer.json index 9a5e7fd6..183f9f24 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ } }, "require-dev": { - "phpunit/phpunit": "6.4.1 || ^5.7 || ^4.8", + "phpunit/phpunit": "^7.5 || ^6.5 || ^5.7 || ^4.8", "smarty/smarty-lexer": "^3.1" } } diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index b3e05a8c..ac4a4e6f 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -16,7 +16,6 @@ if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Frame class_alias('\PHPUnit\Framework\Error\Error', '\PHPUnit_Framework_Error_Error'); class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Warning'); class_alias('\PHPUnit\Framework\Error\Warning', '\PHPUnit_Framework_Error_Deprecated'); - class_alias('\PHPUnit\Util\Configuration', '\PHPUnit_Util_Configuration'); } require_once 'PHPUnit_Smarty.php'; diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php index 229420f0..a23d6aa0 100644 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php +++ b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php @@ -72,6 +72,8 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty } elseif (PHP_VERSION_ID >= 56000) { $this->expectExceptionMessage("Undefined index: foo"); $this->expectException(PHPUnit_Framework_Error_Notice::class); + } else { + return; // skip this test } $e1 = error_reporting(); $this->assertEquals('undefined = ', $this->smarty->fetch('001_main.tpl'));