construct_info_retrieval_error( $request, $response ); } else { $json = json_decode( $response['body'] ); if ( isset( $json->error ) ) { $result = new WP_Error( 'blip_invalid_url', sprintf( __( 'Error retrieving video information for %1$s. Check to be sure this is a valid Blip video URL.', 'video-thumbnails' ), $url ) ); } else { $result = $json->thumbnail_url; } } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => 'http://blip.tv/cranetv/illustrator-katie-scott-6617917', 'expected' => 'http://a.images.blip.tv/CraneTV-IllustratorKatieScott610.jpg', 'expected_hash' => '26a622f72bd4bdb3f8189f85598dd95d', 'name' => __( 'Video URL', 'video-thumbnails' ) ), array( 'markup' => '', 'expected' => 'http://a.images.blip.tv/GeekCrashCourse-TheAvengersMarvelMovieCatchUpGeekCrashCourse331.png', 'expected_hash' => '87efa9f6b0d9111b0826ae4fbdddec1b', 'name' => __( 'iFrame Embed', 'video-thumbnails' ) ), ); } } ?>