Skip to content

Commit b310d73

Browse files
ajgarlaggreg0ire
authored andcommitted
Use RequiresMethod attribute to skip test
1 parent 8930440 commit b310d73

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use PDO;
3232
use PHPUnit\Framework\Attributes\DataProvider;
3333
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
34+
use PHPUnit\Framework\Attributes\RequiresMethod;
3435
use PHPUnit\Framework\TestCase;
3536
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
3637
use Symfony\Bundle\DoctrineBundle\Tests\DependencyInjection\TestHydrator;
@@ -1495,6 +1496,7 @@ public function testDisableSchemaValidation(): void
14951496
}
14961497

14971498
#[IgnoreDeprecations]
1499+
#[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')]
14981500
public function testNativeLazyObjectsWithoutConfig(): void
14991501
{
15001502
if (! interface_exists(EntityManagerInterface::class)) {
@@ -1509,10 +1511,6 @@ public function testNativeLazyObjectsWithoutConfig(): void
15091511
self::markTestSkipped('This test requires PHP 8.4+');
15101512
}
15111513

1512-
if (! method_exists(ProxyHelper::class, 'generateLazyGhost')) {
1513-
self::markTestSkipped('This test requires symfony/var-exporter < 8');
1514-
}
1515-
15161514
$container = $this->loadContainer(
15171515
fixture: 'orm_native_lazy_objects_default',
15181516
withMinimalOrmConfig: false,
@@ -1543,6 +1541,7 @@ public function testNativeLazyObjectsWithConfigTrue(): void
15431541
}
15441542

15451543
#[IgnoreDeprecations]
1544+
#[RequiresMethod(ProxyHelper::class, 'generateLazyGhost')]
15461545
public function testNativeLazyObjectsWithConfigFalse(): void
15471546
{
15481547
if (! interface_exists(EntityManagerInterface::class)) {
@@ -1557,10 +1556,6 @@ public function testNativeLazyObjectsWithConfigFalse(): void
15571556
self::markTestSkipped('This test requires PHP 8.4+');
15581557
}
15591558

1560-
if (! method_exists(ProxyHelper::class, 'generateLazyGhost')) {
1561-
self::markTestSkipped('This test requires symfony/var-exporter < 8');
1562-
}
1563-
15641559
$container = $this->loadContainer(
15651560
fixture: 'orm_native_lazy_objects_disable',
15661561
withMinimalOrmConfig: false,

0 commit comments

Comments
 (0)