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
This commit is contained in:
Sergey Biryukov 2018-07-18 09:51:53 +00:00
parent 6f0218d8bc
commit 9daa08da8e
1 changed files with 5 additions and 0 deletions

View File

@ -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 ),