Skip the tests when PHP_VERSION < 8

This commit is contained in:
huangzhhui 2021-09-21 03:37:10 +08:00 committed by 李铭昕
parent bd4eabcc89
commit 8872a5c658

View File

@ -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');