Skip to content

Commit 4047600

Browse files
committed
fix: disable cache clearing in bundle tests
Disables the cache clearing as NyholmBundleTest seems to look at a different cache directory than the one available during testing. Also ignore a specific PHPStan error that has been reported as a bug.
1 parent 0c30a70 commit 4047600

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ 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
}
@@ -105,6 +105,7 @@ public function process(ContainerBuilder $container): void
105105
});
106106

107107
$kernel->handleOptions($options);
108+
$kernel->setClearCacheAfterShutdown(false);
108109

109110
return $kernel;
110111
}

0 commit comments

Comments
 (0)