From 25461b358c140d7f9c5d97061dfe5131cfd75c83 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sat, 5 Oct 2019 08:23:15 +0200 Subject: [PATCH] Skip the intl notice if run with phpunit --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- .../Tests/Functional/SluggerLocaleAwareTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index a8d30e8e16..fa06c0eadd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -205,7 +205,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); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SluggerLocaleAwareTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SluggerLocaleAwareTest.php index 311b3ed5ec..d8552977c0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SluggerLocaleAwareTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/SluggerLocaleAwareTest.php @@ -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']);