Skip to content

Commit c47e9e2

Browse files
committed
Tweak test setup for newest releases
1 parent a59d46d commit c47e9e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Adapter/Doctrine/ORM/Tests/ORMTestCase.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ protected function setUp(): void
1919
$config->setMetadataCache(new ArrayAdapter());
2020
$config->setQueryCache(new ArrayAdapter());
2121
$config->setResultCache(new ArrayAdapter());
22-
$config->setProxyDir(__DIR__.'/_files');
23-
$config->setProxyNamespace(__NAMESPACE__.'\Proxies');
2422
$config->setMetadataDriverImpl(new AttributeDriver([__DIR__.'/Entity']));
2523

24+
/** @phpstan-ignore-next-line function.alreadyNarrowedType */
25+
if (\PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) {
26+
$config->enableNativeLazyObjects(true);
27+
} else {
28+
$config->setProxyDir(__DIR__.'/_files');
29+
$config->setProxyNamespace(__NAMESPACE__.'\Proxies');
30+
}
31+
2632
$conn = [
2733
'driver' => 'pdo_sqlite',
2834
'memory' => true,

0 commit comments

Comments
 (0)