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
This commit is contained in:
Andrew Nacin 2014-02-12 20:39:21 +00:00
parent 4db1f2cb20
commit 36fe6c1c27
1 changed files with 4 additions and 0 deletions

View File

@ -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, '/' ) );