minor #33868 Skip the intl notice if run with phpunit (jakzal)

This PR was squashed before being merged into the 5.0-dev branch (closes #33868).

Discussion
----------

Skip the intl notice if run with phpunit

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Re #33825
| License       | MIT
| Doc PR        | -

Commits
-------

25461b358c Skip the intl notice if run with phpunit
This commit is contained in:
Nicolas Grekas 2019-10-07 10:06:29 +02:00
commit 53f86271e6
2 changed files with 4 additions and 1 deletions

View File

@ -211,7 +211,7 @@ class FrameworkExtension extends Extension
->addError('You cannot use the "slugger" service since the Translation contracts are not installed. Try running "composer require symfony/translation".');
}
if (!\extension_loaded('intl')) {
if (!\extension_loaded('intl') && !\defined('PHPUNIT_COMPOSER_INSTALL')) {
@trigger_error('Please install the "intl" PHP extension for best performance.', E_USER_DEPRECATED);
}
}

View File

@ -16,6 +16,9 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
*/
class SluggerLocaleAwareTest extends AbstractWebTestCase
{
/**
* @requires extension intl
*/
public function testLocalizedSlugger()
{
$kernel = static::createKernel(['test_case' => 'Slugger', 'root_config' => 'config.yml']);