From 8872a5c658bb42a720fb482ffa13a08fd2b22e0a Mon Sep 17 00:00:00 2001 From: huangzhhui Date: Tue, 21 Sep 2021 03:37:10 +0800 Subject: [PATCH] Skip the tests when PHP_VERSION < 8 --- src/di/tests/AnnotationReaderTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/di/tests/AnnotationReaderTest.php b/src/di/tests/AnnotationReaderTest.php index b6c8f803b..632f33f06 100644 --- a/src/di/tests/AnnotationReaderTest.php +++ b/src/di/tests/AnnotationReaderTest.php @@ -36,6 +36,9 @@ class AnnotationReaderTest extends TestCase public function testGetNotFoundAttributesOfClass() { + if (\PHP_VERSION_ID < 80000) { + $this->markTestSkipped('The test only for PHP 8'); + } $reflectionClass = new ReflectionClass(NotFoundAttributeTarget::class); $exceptionMessage = "No attribute class found for 'HyperfTest\\Di\\Stub\\NotExistAttribute' in HyperfTest\\Di\\Stub\\NotFoundAttributeTarget"; @@ -55,6 +58,9 @@ class AnnotationReaderTest extends TestCase public function testGetNotFoundAttributesOfMethod() { + if (\PHP_VERSION_ID < 80000) { + $this->markTestSkipped('The test only for PHP 8'); + } $reflectionClass = new ReflectionClass(NotFoundAttributeTarget::class); $reflectionMethod = $reflectionClass->getMethod('foo'); @@ -75,6 +81,9 @@ class AnnotationReaderTest extends TestCase public function testGetNotFoundAttributesOfProperty() { + if (\PHP_VERSION_ID < 80000) { + $this->markTestSkipped('The test only for PHP 8'); + } $reflectionClass = new ReflectionClass(NotFoundAttributeTarget::class); $reflectionProperty = $reflectionClass->getProperty('foo');