Skip to content

Commit f9d6ab3

Browse files
committed
fix: disable ORM native lazy object on Symfony 6.4 in tests
Disable native lazy objects in tests for Symfony 6.4 as they do not seems to work well with the testsuite. Also ignore a specific PHPStan error that has been reported as a bug.
1 parent 0c30a70 commit f9d6ab3

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

phpstan-baseline.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,12 @@
207207
'count' => 1,
208208
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
209209
];
210+
// See https://github.com/phpstan/phpstan/issues/14067
211+
$ignoreErrors[] = [
212+
'message' => '#^Parameter \\#1 \\$provider of class Bazinga\\\\GeocoderBundle\\\\Mapping\\\\ClassMetadata constructor expects non-empty-string, ReflectionMethod\\|ReflectionProperty\\|non-empty-string given\\.$#',
213+
'identifier' => 'argument.type',
214+
'count' => 1,
215+
'path' => __DIR__.'/src/Mapping/Driver/AttributeDriver.php',
216+
];
210217

211218
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

tests/Functional/GeocodeEntityListenerTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,17 @@ public function process(ContainerBuilder $container): void
9292
$orm['enable_lazy_ghost_objects'] = true;
9393
}
9494
if (\PHP_VERSION_ID >= 80400
95-
&& version_compare($doctrineBundleVersion, '2.15.0', '>=')
96-
&& version_compare($doctrineBundleVersion, '3.1.0', '<')
97-
&& version_compare($ormVersion, '3.4.0', '>=')
95+
&& version_compare($doctrineBundleVersion, '2.15.0', '>=')
96+
&& version_compare($doctrineBundleVersion, '3.1.0', '<')
97+
&& version_compare($ormVersion, '3.4.0', '>=')
9898
) {
9999
$orm['enable_native_lazy_objects'] = true;
100100
}
101+
102+
if (Kernel::VERSION_ID <= 70000) {
103+
$orm['enable_lazy_ghost_objects'] = false;
104+
$orm['enable_native_lazy_objects'] = false;
105+
}
101106
}
102107
$container->prependExtensionConfig('doctrine', [
103108
'orm' => $orm,

0 commit comments

Comments
 (0)