Skip to content

Commit 6285c18

Browse files
committed
Skip tests on PHP < 8.4 loading all document classes, including those with property hooks
1 parent 20ac541 commit 6285c18

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/Doctrine/ODM/MongoDB/Tests/Mapping/AbstractAnnotationDriverTestCase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Documents\CmsUser;
1414
use Generator;
1515
use PHPUnit\Framework\Attributes\DataProvider;
16+
use PHPUnit\Framework\Attributes\RequiresPhp;
1617
use stdClass;
1718

1819
use function assert;
@@ -92,18 +93,18 @@ public function testColumnWithMissingTypeDefaultsToString(): void
9293
}
9394

9495
/** @group DDC-318 */
96+
#[RequiresPhp('>= 8.4')]
9597
public function testGetAllClassNamesIsIdempotent(): void
9698
{
9799
$annotationDriver = $this->loadDriverForCMSDocuments();
98100
$original = $annotationDriver->getAllClassNames();
99-
100-
$annotationDriver = $this->loadDriverForCMSDocuments();
101101
$afterTestReset = $annotationDriver->getAllClassNames();
102102

103103
self::assertEquals($original, $afterTestReset);
104104
}
105105

106106
/** @group DDC-318 */
107+
#[RequiresPhp('>= 8.4')]
107108
public function testGetAllClassNamesIsIdempotentEvenWithDifferentDriverInstances(): void
108109
{
109110
$annotationDriver = $this->loadDriverForCMSDocuments();
@@ -116,15 +117,18 @@ public function testGetAllClassNamesIsIdempotentEvenWithDifferentDriverInstances
116117
}
117118

118119
/** @group DDC-318 */
120+
#[RequiresPhp('>= 8.4')]
119121
public function testGetAllClassNamesReturnsAlreadyLoadedClassesIfAppropriate(): void
120122
{
123+
self::assertTrue(class_exists(CmsUser::class), 'Pre-load the class');
121124
$annotationDriver = $this->loadDriverForCMSDocuments();
122125
$classes = $annotationDriver->getAllClassNames();
123126

124127
self::assertContains(CmsUser::class, $classes);
125128
}
126129

127130
/** @group DDC-318 */
131+
#[RequiresPhp('>= 8.4')]
128132
public function testGetClassNamesReturnsOnlyTheAppropriateClasses(): void
129133
{
130134
$extraneousClassName = ColumnWithoutType::class;

0 commit comments

Comments
 (0)