From 6695cc7e063a08fd49e3bd1446d2c3c7f78ff37c Mon Sep 17 00:00:00 2001 From: Dennis Riehle Date: Wed, 29 Dec 2021 13:44:00 +0100 Subject: [PATCH] exclude IconvTest from running on Alpine Linux Signed-off-by: Dennis Riehle --- test/StringWrapper/IconvTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/StringWrapper/IconvTest.php b/test/StringWrapper/IconvTest.php index e9f78776..ccbd1b8e 100644 --- a/test/StringWrapper/IconvTest.php +++ b/test/StringWrapper/IconvTest.php @@ -10,6 +10,10 @@ use function array_shift; use function extension_loaded; +use function file_exists; +use function file_get_contents; +use function is_readable; +use function stripos; class IconvTest extends CommonStringWrapperTest { @@ -24,6 +28,19 @@ protected function setUp(): void } } + /** + * ext-iconv is not properly supported on Alpine Linux, hence, we skip the tests for now + * + * @see https://github.com/nunomaduro/phpinsights/issues/43 + * @see https://github.com/docker-library/php/issues/240#issuecomment-353678474 + */ + if (file_exists('/etc/os-release') && is_readable('/etc/os-release')) { + $osRelease = file_get_contents('/etc/os-release'); + if (stripos($osRelease, 'Alpine Linux') !== false) { + $this->markTestSkipped('iconv not properly supported on Alpine Linux'); + } + } + parent::setUp(); }