From 36fe6c1c273d4f041bfe30efb9808367d277a374 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 12 Feb 2014 20:39:21 +0000 Subject: [PATCH] Don't use HTTPS in unit tests if OpenSSL isn't loaded. props bpetty. fixes #27114. git-svn-id: https://develop.svn.wordpress.org/trunk@27168 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/includes/trac.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/includes/trac.php b/tests/phpunit/includes/trac.php index 70b56a0a13..6092a927c4 100644 --- a/tests/phpunit/includes/trac.php +++ b/tests/phpunit/includes/trac.php @@ -14,6 +14,10 @@ class TracTickets { * @return bool|null true if the ticket is resolved, false if not resolved, null on error */ public static function isTracTicketClosed( $trac_url, $ticket_id ) { + if ( ! extension_loaded( 'openssl' ) ) { + $trac_url = preg_replace( "/^https:/", "http:", $trac_url ); + } + if ( ! isset( self::$trac_ticket_cache[ $trac_url ] ) ) { // In case you're running the tests offline, keep track of open tickets. $file = DIR_TESTDATA . '/.trac-ticket-cache.' . str_replace( array( 'http://', 'https://', '/' ), array( '', '', '-' ), rtrim( $trac_url, '/' ) );