Fix stuff

This commit is contained in:
Brabli
2022-07-20 22:21:00 +01:00
parent 5de4902f00
commit 39c32fdb1b
3 changed files with 9 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ namespace Pcm\GeocodeBundle\Tests;
use Pcm\GeocodeBundle\PcmGeocodeBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
@@ -16,14 +17,10 @@ class AppKernel extends Kernel
*/
public function registerBundles(): array
{
$bundles = array();
if (in_array($this->getEnvironment(), array('test'))) {
$bundles[] = new FrameworkBundle();
$bundles[] = new PcmGeocodeBundle();
}
return $bundles;
return [
new FrameworkBundle(),
new PcmGeocodeBundle()
];
}
/**
@@ -31,6 +28,8 @@ class AppKernel extends Kernel
*/
public function registerContainerConfiguration(LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config_'.$this->getEnvironment().'.yml');
$loader->load(function (ContainerBuilder $container) {
$container->prependExtensionConfig('framework', ['test' => true]);
});
}
}