Skip to content

Commit 76ca8f4

Browse files
committed
Move PHP version check to setUpBeforeClass for AttributeDriver test
1 parent fed6c5a commit 76ca8f4

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

Tests/Mapping/Driver/AttributeDriverTest.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ class AttributeDriverTest extends TestCase
3939
*/
4040
private $reader;
4141

42+
public static function doSetUpBeforeClass(): void
43+
{
44+
if (PHP_VERSION_ID < 80000) {
45+
self::markTestSkipped(sprintf('"%s" is only supported on PHP 8', AttributeDriver::class));
46+
}
47+
}
48+
4249
protected function doSetUp(): void
4350
{
4451
$this->driver = new AttributeDriver();
4552
}
4653

47-
/**
48-
* @requires PHP 8
49-
*/
5054
public function testLoadMetadata()
5155
{
52-
if (PHP_VERSION_ID < 80000) {
53-
$this->markTestSkipped(sprintf('"%s" is only supported on PHP 8', AttributeDriver::class));
54-
}
55-
5656
$obj = new Dummy3();
5757
$metadata = $this->driver->loadMetadataFromObject($obj);
5858

@@ -61,30 +61,16 @@ public function testLoadMetadata()
6161
$this->assertInstanceOf('ReflectionProperty', $metadata->longitudeProperty);
6262
}
6363

64-
/**
65-
* @requires PHP 8
66-
*/
6764
public function testLoadMetadataFromWrongObject()
6865
{
69-
if (PHP_VERSION_ID < 80000) {
70-
$this->markTestSkipped(sprintf('"%s" is only supported on PHP 8', AttributeDriver::class));
71-
}
72-
7366
$this->expectException(MappingException::class);
7467
$this->expectExceptionMessage('The class '.Dummy4::class.' is not geocodeable');
7568

7669
$this->driver->loadMetadataFromObject(new Dummy4());
7770
}
7871

79-
/**
80-
* @requires PHP 8
81-
*/
8272
public function testIsGeocodable()
8373
{
84-
if (PHP_VERSION_ID < 80000) {
85-
$this->markTestSkipped(sprintf('"%s" is only supported on PHP 8', AttributeDriver::class));
86-
}
87-
8874
$this->assertTrue($this->driver->isGeocodeable(new Dummy3()));
8975
}
9076
}

0 commit comments

Comments
 (0)