From 2186e205cb7fde39b1a50a52e33441d17015e974 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Thu, 6 Jan 2022 13:36:28 +0100 Subject: [PATCH 1/5] Modernize requirements and test suite PHP Unit 4 don't work on PHP >= 8 so we switch to PHP Unit 6 which forces to rewrite test cases and abandon PHP < 7. --- .travis.yml | 7 ++++--- composer.json | 4 ++-- tests/ITTest.php | 6 +++--- tests/ITXTest.php | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index fde4647..05a2cfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,13 @@ language: php sudo: false php: - - 5.4 - - 5.5 - - 5.6 - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 + - 8.0 + - 8.1 script: - pear list - pear channel-update pear.php.net diff --git a/composer.json b/composer.json index 5cbd620..ce3c288 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,10 @@ }, "type": "library", "require": { - "php": ">=5.4", + "php": ">=7.0", "pear/pear-core-minimal": "^1.10.1" }, "require-dev": { - "phpunit/phpunit": "^4" + "phpunit/phpunit": "^6" } } diff --git a/tests/ITTest.php b/tests/ITTest.php index ac95752..bbe2ba3 100644 --- a/tests/ITTest.php +++ b/tests/ITTest.php @@ -1,7 +1,7 @@ tpl = new HTML_Template_IT(dirname(__FILE__) . '/templates'); } - function tearDown() + protected function tearDown(): void { unset($this->tpl); } diff --git a/tests/ITXTest.php b/tests/ITXTest.php index 87f19c2..ebf6dfb 100644 --- a/tests/ITXTest.php +++ b/tests/ITXTest.php @@ -23,7 +23,7 @@ static function _numberFormatCallback($float, $decimals) class ITXTest extends ITTest { - function setUp() + function setUp(): void { $this->tpl = new HTML_Template_ITX(dirname(__FILE__) . '/templates'); } From 9edd673bd327c0536685bd9ddeb810a29d33f3b1 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Thu, 6 Jan 2022 18:28:38 +0100 Subject: [PATCH 2/5] Minimal adaptations to run AllTests.php (which is launch by the travis job.). --- tests/AllTests.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/AllTests.php b/tests/AllTests.php index 0059556..79167a2 100644 --- a/tests/AllTests.php +++ b/tests/AllTests.php @@ -11,15 +11,17 @@ class HTML_Template_IT_AllTests { + private static $runner; + public static function main() { - - PHPUnit_TextUI_TestRunner::run(self::suite()); + $runner = new PHPUnit\TextUI\TestRunner; + $runner->run(self::suite()); } public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('HTML_Template_IT tests'); + $suite = new PHPUnit\Framework\TestSuite('HTML_Template_IT tests'); $suite->addTestSuite('ITTest'); $suite->addTestSuite('ITXTest'); From 0025d9bc56c3e3dcef7c6c10df4945c63547ae45 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Thu, 6 Jan 2022 18:45:29 +0100 Subject: [PATCH 3/5] PHP Unit >= 9.3 is needed for PHP >= 8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ce3c288..87b64c8 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,6 @@ "pear/pear-core-minimal": "^1.10.1" }, "require-dev": { - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^9.3" } } From 56c42cd380b48ac904ca611f9df4860522c333c4 Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Thu, 6 Jan 2022 18:47:35 +0100 Subject: [PATCH 4/5] Correct version for PHP 8.1.0 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 05a2cfe..c7f079d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ php: - 7.3 - 7.4 - 8.0 - - 8.1 + - 8.1.0 script: - pear list - pear channel-update pear.php.net From 8ea4dbc38816e501097e620980d535c0e9d709eb Mon Sep 17 00:00:00 2001 From: Mathieu Dubois Date: Mon, 22 Jul 2024 21:50:43 +0200 Subject: [PATCH 5/5] Add recent PHP versions --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index efc9074..61206d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ php: - 7.4 - 8.0 - 8.1.0 + - 8.2.0 + - 8.3.0 # Disable xdebug for PHP >= 7.3 # https://stackoverflow.com/questions/65172031/vendor-bin-phpunit-exited-with-2 before_script: