Skip to content

Commit

Permalink
minor #13701 [2.7] [FrameworkBundle] bugfix in configuration for asse…
Browse files Browse the repository at this point in the history
…ts (phansys)

This PR was merged into the 2.7 branch.

Discussion
----------

[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 breaks 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").

Commits
-------

3b4c23f [2.7] [FrameworkBundle] bugfix in configuration for assets
  • Loading branch information
fabpot committed Feb 16, 2015
2 parents 6d52112 + 3b4c23f commit baf13c1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Expand Up @@ -65,7 +65,7 @@ public function getConfigTreeBuilder()

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

$v['assets'] = array(
Expand Down
Expand Up @@ -86,6 +86,25 @@ public function testInvalidValueTrustedProxies()
));
}

/**
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
* @expectedExceptionMessage You cannot use assets settings under "framework.templating" and "assets" configurations in the same project.
*/
public function testInvalidValueAssets()
{
$processor = new Processor();
$configuration = new Configuration(true);
$processor->processConfiguration($configuration, array(
array(
'templating' => array(
'engines' => null,
'assets_base_urls' => '//example.com',
),
'assets' => null,
),
));
}

protected static function getBundleDefaultConfig()
{
return array(
Expand Down

0 comments on commit baf13c1

Please sign in to comment.