Skip to content

Commit 8e31c59

Browse files
committed
bug #18657 [FrameworkBundle] Fix a typo and add a test to prevent new regressions (Ener-Getick)
This PR was merged into the 3.1-dev branch. Discussion ---------- [FrameworkBundle] Fix a typo and add a test to prevent new regressions | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This fixes a typo introduced in #18630 and adds a new functional test to avoid most regressions in service definitions in the future when features are only available in non-debug mode. cc @nicolas-grekas Commits ------- 61872ce Fix a typo and add a check to prevent regressions
2 parents f4b2ff1 + aa84754 commit 8e31c59

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
998998
$cacheMetadataFactory = new Definition(
999999
CacheClassMetadataFactory::class,
10001000
array(
1001-
new Reference('serializer.mapping.class_metadata_factory.inner'),
1001+
new Reference('serializer.mapping.cache_class_metadata_factory.inner'),
10021002
new Reference('cache.pool.serializer'),
10031003
)
10041004
);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
13+
14+
/**
15+
* Checks that the container compiles correctly when all the bundle features are enabled.
16+
*/
17+
class ContainerDumpTest extends WebTestCase
18+
{
19+
public function testContainerCompilationInDebug()
20+
{
21+
$client = $this->createClient(array('test_case' => 'ContainerDump', 'root_config' => 'config.yml'));
22+
23+
$this->assertTrue($client->getContainer()->has('serializer'));
24+
}
25+
26+
public function testContainerCompilation()
27+
{
28+
$client = $this->createClient(array('test_case' => 'ContainerDump', 'root_config' => 'config.yml', 'debug' => false));
29+
30+
$this->assertTrue($client->getContainer()->has('serializer'));
31+
}
32+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
13+
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
14+
15+
return array(
16+
new FrameworkBundle(),
17+
new TestBundle(),
18+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
imports:
2+
- { resource: ../config/default.yml }
3+
4+
framework:
5+
esi: true
6+
ssi: true
7+
fragments: true
8+
profiler: true
9+
router: true
10+
session: true
11+
request: true
12+
templating:
13+
enabled: true
14+
engines: ['php']
15+
assets: true
16+
translator: true
17+
validation: true
18+
serializer: true
19+
property_info: true
20+
csrf_protection: true
21+
form: true

0 commit comments

Comments
 (0)