From 4070b12ea90b947ae3acc6ffaf35e29585225acf Mon Sep 17 00:00:00 2001 From: Anton Vasiliev Date: Sat, 11 Sep 2021 22:04:30 +0100 Subject: [PATCH] #2255 - Fix `IsPhpVersionTest` test for PHP8.1 --- tests/Extension/Optimizers/IsPhpVersionTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Extension/Optimizers/IsPhpVersionTest.php b/tests/Extension/Optimizers/IsPhpVersionTest.php index 72467c7cef..c16c816b73 100644 --- a/tests/Extension/Optimizers/IsPhpVersionTest.php +++ b/tests/Extension/Optimizers/IsPhpVersionTest.php @@ -85,12 +85,15 @@ public function testOptimizerExceptionNegativeNumber(): void $this->isPhpVersion(-7); } - public function testOptimizerExceptionNull(): void + public function testOptimizerExceptionEmpty(): void { $this->expectException(Exception::class); $this->expectExceptionMessage('Could not parse PHP version'); - $this->isPhpVersion(null); + /** + * After PHP8.1 it is impossible to pass null value to preg_match() + */ + $this->isPhpVersion(''); } public function testZephirUsingInteger70000(): void