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

@@ -1,4 +0,0 @@
services:
Pcm\GeocodeBundle\Service\Geocoder:
autowire: true
public: true

View File

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

View File

@@ -10,6 +10,7 @@ use Pcm\GeocodeBundle\Service\Geocoder;
use Pcm\GeocodeBundle\Tests\AppKernel; use Pcm\GeocodeBundle\Tests\AppKernel;
use Pcm\GeocodeBundle\Trait\MappableTrait; use Pcm\GeocodeBundle\Trait\MappableTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpKernel\KernelInterface;
class GeocodeTest extends KernelTestCase class GeocodeTest extends KernelTestCase
{ {