construct_info_retrieval_error( $request, $response ); } else { $xml = new SimpleXMLElement( $response['body'] ); $result = (string) $xml->result->item->id; $request = "http://www.kaltura.com/api_v3/?service=thumbAsset&action=geturl&id=$result"; $response = wp_remote_get( $request ); if( is_wp_error( $response ) ) { $result = $this->construct_info_retrieval_error( $request, $response ); } else { $xml = new SimpleXMLElement( $response['body'] ); $result = (string) $xml->result; } } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => '', 'expected' => 'http://example.com/thumbnail.jpg', 'name' => __( 'Auto Embed', 'video-thumbnails' ) ), ); } } ?>