From a0e2b022a9012f8184a5c1ea430b7158f640eeab Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Sun, 3 May 2026 22:31:13 +0200 Subject: [PATCH 1/2] add support for testing smarty v4 on php8.5 --- .github/workflows/ci.yml | 1 + docker-compose.yml | 5 +++++ run-tests-for-all-php-versions.sh | 5 +++-- .../TagTests/BockExtend/CompileBlockExtendsTest.php | 6 +++--- .../TagTests/Include/CompileIncludeTest.php | 2 +- .../TemplateSource/_Issues/419/ExtendsIssue419Test.php | 2 +- utilities/testrunners/php85/Dockerfile | 10 ++++++++++ 7 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 utilities/testrunners/php85/Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7160153db..5251cb1c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: - "8.2" - "8.3" - "8.4" + - "8.5" compiler: - default diff --git a/docker-compose.yml b/docker-compose.yml index 64b504b81..678c941e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,3 +52,8 @@ services: service: base build: dockerfile: ./utilities/testrunners/php84/Dockerfile + php85: + extends: + service: base + build: + dockerfile: ./utilities/testrunners/php85/Dockerfile diff --git a/run-tests-for-all-php-versions.sh b/run-tests-for-all-php-versions.sh index 850ab3f9a..b89cb629d 100755 --- a/run-tests-for-all-php-versions.sh +++ b/run-tests-for-all-php-versions.sh @@ -5,7 +5,7 @@ # - ./run-tests-for-all-php-versions.sh --group 20221124 # - ./run-tests-for-all-php-versions.sh --exclude-group slow -COMPOSE_CMD="mutagen-compose" +COMPOSE_CMD="docker-compose" $COMPOSE_CMD run --rm php71 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php72 ./run-tests.sh $@ && \ @@ -15,4 +15,5 @@ $COMPOSE_CMD run --rm php80 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php81 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php82 ./run-tests.sh $@ && \ $COMPOSE_CMD run --rm php83 ./run-tests.sh $@ && \ -$COMPOSE_CMD run --rm php84 ./run-tests.sh $@ +$COMPOSE_CMD run --rm php84 ./run-tests.sh $@ && \ +$COMPOSE_CMD run --rm php85 ./run-tests.sh $@ diff --git a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php index 91908deb3..07b8f20e9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/BockExtend/CompileBlockExtendsTest.php @@ -1381,7 +1381,7 @@ public function testBlockWithAssign() { public function testEscaping() { $this->expectException(SmartyException::class); - $this->expectExceptionMessageRegExp('/Unable to load.*/'); + $this->expectExceptionMessageMatches('/Unable to load.*/'); $this->assertEquals('hello world', $this->smarty->fetch('escaping.tpl')); } @@ -1391,7 +1391,7 @@ public function testEscaping() public function testEscaping2() { $this->expectException(SmartyException::class); - $this->expectExceptionMessageRegExp('/Unable to load.*/'); + $this->expectExceptionMessageMatches('/Unable to load.*/'); $this->assertEquals('hello world', $this->smarty->fetch('escaping2.tpl')); } @@ -1401,7 +1401,7 @@ public function testEscaping2() public function testEscaping3() { $this->expectException(SmartyException::class); - $this->expectExceptionMessageRegExp('/Unable to load.*/'); + $this->expectExceptionMessageMatches('/Unable to load.*/'); $this->assertEquals('hello world', $this->smarty->fetch('escaping3.tpl')); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php index 4b5c52439..b3bc30836 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Include/CompileIncludeTest.php @@ -88,7 +88,7 @@ public function testSpacing_001V3($merge, $caching, $text) public function testIncludeFilenameEscaping() { $this->expectException(SmartyException::class); - $this->expectExceptionMessageRegExp('/Unable to load.*/'); + $this->expectExceptionMessageMatches('/Unable to load.*/'); $tpl = $this->smarty->createTemplate('test_include_security.tpl'); $content = $this->smarty->fetch($tpl); $this->assertEquals("hello world", $content); diff --git a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php index 322322d77..94217e738 100644 --- a/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php +++ b/tests/UnitTests/TemplateSource/_Issues/419/ExtendsIssue419Test.php @@ -35,7 +35,7 @@ public function testextends419() public function testextendsSecurity() { $this->expectException(SmartyException::class); - $this->expectExceptionMessageRegExp('/Unable to load.*/'); + $this->expectExceptionMessageMatches('/Unable to load.*/'); $this->assertEquals('child', $this->smarty->fetch('string:{include "001_parent.tpl\', var_dump(shell_exec(\'ls\')), 1, 2, 3, 4, 5, 6);}}?>"}')); } diff --git a/utilities/testrunners/php85/Dockerfile b/utilities/testrunners/php85/Dockerfile new file mode 100644 index 000000000..46bde811a --- /dev/null +++ b/utilities/testrunners/php85/Dockerfile @@ -0,0 +1,10 @@ +FROM php:8.5-rc-cli-bullseye + +## Basic utilities +RUN apt-get update -yqq && apt-get install -y curl apt-utils git zip unzip + +## Composer +COPY ./utilities/testrunners/shared/install-composer.sh /root/install-composer.sh +WORKDIR /root +RUN sh ./install-composer.sh +RUN mv ./composer.phar /usr/local/bin/composer From 56cf94dacd7392c299252d8fcde6fcb27c6ad22b Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Sun, 3 May 2026 22:32:41 +0200 Subject: [PATCH 2/2] changelog / docs --- README.md | 2 +- changelog/1184.md | 1 + docs/getting-started.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog/1184.md diff --git a/README.md b/README.md index b6271e61b..5689e81b7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Smarty is a template engine for PHP, facilitating the separation of presentation Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it. ## Requirements -Smarty can be run with PHP 7.1 to PHP 8.4. +Smarty can be run with PHP 7.1 to PHP 8.5. ## Installation Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/). diff --git a/changelog/1184.md b/changelog/1184.md new file mode 100644 index 000000000..7b5c83353 --- /dev/null +++ b/changelog/1184.md @@ -0,0 +1 @@ +- PHP8.5 support [#1184](https://github.com/smarty-php/smarty/issues/1184) \ No newline at end of file diff --git a/docs/getting-started.md b/docs/getting-started.md index adf949726..c0e426652 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,7 +1,7 @@ # Getting started ## Requirements -Smarty can be run with PHP 7.1 to PHP 8.4. +Smarty can be run with PHP 7.1 to PHP 8.5. ## Installation Smarty can be installed with [Composer](https://getcomposer.org/).