bug #22032 [FrameworkBundle] Fix translation dep constraint (chalasr)

This PR was merged into the 3.2 branch.

Discussion
----------

[FrameworkBundle] Fix translation dep constraint

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | n/a

The framework Translator makes use of the Translator component domain exceptions which exist since 3.2 only, leading to a fatal error when one of these exceptions is thrown in the framework using `symfony/translations:<3.2`. Bug introduced in https://github.com/symfony/symfony/pull/20012

Commits
-------

e1caf7d [FrameworkBundle] Fix translation dep constraint
This commit is contained in:
Nicolas Grekas 2017-03-17 13:00:40 +01:00
commit 3fe34be1ed
2 changed files with 14 additions and 2 deletions

View File

@ -136,6 +136,17 @@ class TranslatorTest extends TestCase
$this->assertSame('en', $translator->getLocale());
}
/**
* @expectedException \Symfony\Component\Translation\Exception\InvalidArgumentException
* @expectedExceptionMessage The Translator does not support the following options: 'foo'
*/
public function testInvalidOptions()
{
$container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
(new Translator($container, new MessageSelector(), array(), array('foo' => 'bar')));
}
protected function getCatalogue($locale, $messages, $resources = array())
{
$catalogue = new MessageCatalogue($locale);

View File

@ -47,7 +47,7 @@
"symfony/security-core": "~3.2",
"symfony/security-csrf": "~2.8|~3.0",
"symfony/serializer": "~2.8|~3.0",
"symfony/translation": "~2.8|~3.0",
"symfony/translation": "~3.2",
"symfony/templating": "~2.8|~3.0",
"symfony/validator": "~3.2",
"symfony/yaml": "~3.2",
@ -60,7 +60,8 @@
"conflict": {
"phpdocumentor/reflection-docblock": "<3.0",
"phpdocumentor/type-resolver": "<0.2.0",
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/translations": "<3.2"
},
"suggest": {
"ext-apcu": "For best performance of the system caches",