Skip to content

Commit 3b4c23f

Browse files
committed
[2.7] [FrameworkBundle] bugfix in configuration for assets
| Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a If both of configurations are defined, the exception is break because it isn't defined properly (missing backslash in FQCN for ```\LogicException```). Also, the message was wrong (it's referred to "templating.templating" instead of "framework.templating").
1 parent 6d52112 commit 3b4c23f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getConfigTreeBuilder()
6565

6666
// convert the old configuration to the new one
6767
if (isset($v['assets'])) {
68-
throw new LogicException('You cannot use assets settings under "templating.templating" and "assets" configurations in the same project.');
68+
throw new \LogicException('You cannot use assets settings under "framework.templating" and "assets" configurations in the same project.');
6969
}
7070

7171
$v['assets'] = array(

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ public function testInvalidValueTrustedProxies()
8686
));
8787
}
8888

89+
/**
90+
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
91+
* @expectedExceptionMessage You cannot use assets settings under "framework.templating" and "assets" configurations in the same project.
92+
*/
93+
public function testInvalidValueAssets()
94+
{
95+
$processor = new Processor();
96+
$configuration = new Configuration(true);
97+
$processor->processConfiguration($configuration, array(
98+
array(
99+
'templating' => array(
100+
'engines' => null,
101+
'assets_base_urls' => '//example.com',
102+
),
103+
'assets' => null,
104+
),
105+
));
106+
}
107+
89108
protected static function getBundleDefaultConfig()
90109
{
91110
return array(

0 commit comments

Comments
 (0)