Attempt to get dep injection working in tests
This commit is contained in:
36
tests/AppKernel.php
Normal file
36
tests/AppKernel.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pcm\GeocodeBundle\Tests;
|
||||
|
||||
use Pcm\GeocodeBundle\PcmGeocodeBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function registerBundles(): array
|
||||
{
|
||||
$bundles = array();
|
||||
|
||||
if (in_array($this->getEnvironment(), array('test'))) {
|
||||
$bundles[] = new FrameworkBundle();
|
||||
$bundles[] = new PcmGeocodeBundle();
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LoaderInterface $loader
|
||||
*/
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load(__DIR__.'/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user