From 427fffa65cbe32bdee5744befaf1b5de4acf2e1a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 31 Aug 2020 12:29:30 +0200 Subject: [PATCH] skip tests if required class does not exist --- .../Component/Translation/Tests/TranslatorCacheTest.php | 4 ++++ src/Symfony/Component/Translation/Tests/TranslatorTest.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Symfony/Component/Translation/Tests/TranslatorCacheTest.php b/src/Symfony/Component/Translation/Tests/TranslatorCacheTest.php index 8efa318cac0b..a22dcc969f73 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorCacheTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorCacheTest.php @@ -59,6 +59,10 @@ protected function deleteTmpDir() */ public function testThatACacheIsUsed($debug) { + if (!class_exists(\MessageFormatter::class)) { + $this->markTestSkipped(sprintf('Skipping test as the required "%s" class does not exist. Consider installing the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.', \MessageFormatter::class)); + } + $locale = 'any_locale'; $format = 'some_format'; $msgid = 'test'; diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index 2d2e5e40df8a..b3f056fc669c 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorTest.php @@ -373,6 +373,10 @@ public function testTrans($expected, $id, $translation, $parameters, $locale, $d */ public function testTransICU(...$args) { + if (!class_exists(\MessageFormatter::class)) { + $this->markTestSkipped(sprintf('Skipping test as the required "%s" class does not exist. Consider installing the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.', \MessageFormatter::class)); + } + $this->testTrans(...$args); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy