fixed kernel.secret not being overridden when loaded from extension
This commit is contained in:
parent
66a46f0fab
commit
76d398851f
@ -88,6 +88,7 @@ trait MicroKernelTrait
|
|||||||
{
|
{
|
||||||
$loader->load(function (ContainerBuilder $container) use ($loader) {
|
$loader->load(function (ContainerBuilder $container) use ($loader) {
|
||||||
$container->loadFromExtension('framework', [
|
$container->loadFromExtension('framework', [
|
||||||
|
'secret' => '%env(APP_SECRET)%',
|
||||||
'router' => [
|
'router' => [
|
||||||
'resource' => 'kernel::loadRoutes',
|
'resource' => 'kernel::loadRoutes',
|
||||||
'type' => 'service',
|
'type' => 'service',
|
||||||
@ -108,7 +109,6 @@ trait MicroKernelTrait
|
|||||||
|
|
||||||
$container->addObjectResource($this);
|
$container->addObjectResource($this);
|
||||||
$container->fileExists($this->getProjectDir().'/config/bundles.php');
|
$container->fileExists($this->getProjectDir().'/config/bundles.php');
|
||||||
$container->setParameter('kernel.secret', '%env(APP_SECRET)%');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->configureContainer($container, $loader);
|
$this->configureContainer($container, $loader);
|
||||||
|
@ -69,4 +69,12 @@ class MicroKernelTraitTest extends TestCase
|
|||||||
|
|
||||||
$this->assertEquals('Have a great day!', $response->getContent());
|
$this->assertEquals('Have a great day!', $response->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testSecretLoadedFromExtension()
|
||||||
|
{
|
||||||
|
$kernel = new ConcreteMicroKernel('test', false);
|
||||||
|
$kernel->boot();
|
||||||
|
|
||||||
|
self::assertSame('$ecret', $kernel->getContainer()->getParameter('kernel.secret'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user