Skip to content

Commit 45d4205

Browse files
authored
bug #137 Incorporate changes from Sylius/Sylius#9889 (pamil)
This PR was merged into the 1.3 branch. Discussion ---------- Commits ------- 0f8d8af Incorporate changes from Sylius/Sylius#9889
2 parents 677b2fa + 0f8d8af commit 45d4205

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/Application/Kernel.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,23 @@
77
use ProxyManager\Proxy\VirtualProxyInterface;
88
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
99
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
10+
use Symfony\Component\Config\Loader\DelegatingLoader;
1011
use Symfony\Component\Config\Loader\LoaderInterface;
12+
use Symfony\Component\Config\Loader\LoaderResolver;
1113
use Symfony\Component\Config\Resource\FileResource;
1214
use Symfony\Component\DependencyInjection\ContainerBuilder;
1315
use Symfony\Component\DependencyInjection\ContainerInterface;
16+
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
17+
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
18+
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
19+
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
20+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
21+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
22+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
23+
use Symfony\Component\HttpKernel\Config\FileLocator;
1424
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
1525
use Symfony\Component\Routing\RouteCollectionBuilder;
26+
use Webmozart\Assert\Assert;
1627

1728
final class Kernel extends BaseKernel
1829
{
@@ -96,6 +107,25 @@ protected function getContainerBaseClass(): string
96107
return parent::getContainerBaseClass();
97108
}
98109

110+
protected function getContainerLoader(ContainerInterface $container): LoaderInterface
111+
{
112+
/** @var ContainerBuilder $container */
113+
Assert::isInstanceOf($container, ContainerBuilder::class);
114+
115+
$locator = new FileLocator($this, $this->getRootDir() . '/Resources');
116+
$resolver = new LoaderResolver(array(
117+
new XmlFileLoader($container, $locator),
118+
new YamlFileLoader($container, $locator),
119+
new IniFileLoader($container, $locator),
120+
new PhpFileLoader($container, $locator),
121+
new GlobFileLoader($container, $locator),
122+
new DirectoryLoader($container, $locator),
123+
new ClosureLoader($container),
124+
));
125+
126+
return new DelegatingLoader($resolver);
127+
}
128+
99129
private function isTestEnvironment(): bool
100130
{
101131
return 0 === strpos($this->getEnvironment(), 'test');

0 commit comments

Comments
 (0)