From 9daa08da8eb706b465871a1c99ed44cdfcda7053 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 18 Jul 2018 09:51:53 +0000 Subject: [PATCH] Filesystem API: Skip `https://` test for `wp_is_stream()` if `openssl` extension is not loaded. See #44533. git-svn-id: https://develop.svn.wordpress.org/trunk@43503 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/functions.php b/tests/phpunit/tests/functions.php index f8da780b29..8ef550938b 100644 --- a/tests/phpunit/tests/functions.php +++ b/tests/phpunit/tests/functions.php @@ -1461,6 +1461,10 @@ class Tests_Functions extends WP_UnitTestCase { * @param bool $expected Expected result. */ public function test_wp_is_stream( $path, $expected ) { + if ( ! extension_loaded( 'openssl' ) && false !== strpos( $path, 'https://' ) ) { + $this->markTestSkipped( 'The openssl PHP extension is not loaded.' ); + } + $this->assertSame( $expected, wp_is_stream( $path ) ); } @@ -1477,6 +1481,7 @@ class Tests_Functions extends WP_UnitTestCase { public function data_test_wp_is_stream() { return array( // Legitimate stream examples. + array( 'http://example.com', true ), array( 'https://example.com', true ), array( 'ftp://example.com', true ), array( 'file:///path/to/some/file', true ),