construct_info_retrieval_error( $request, $response ); } else { $result = json_decode( $response['body'] ); $result = str_replace( '240x180.jpg', '480x360.jpg', $result->thumbnail_url ); } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => '', 'expected' => 'http://images.ted.com/images/ted/341053090f8bac8c324c75be3114b673b4355e8a_480x360.jpg?lang=en', 'expected_hash' => 'f2a5f6af49e841b4f9c7b95d6ca0372a', 'name' => __( 'iFrame Embed', 'video-thumbnails' ) ), array( 'markup' => '', 'expected' => 'http://images.ted.com/images/ted/b1f1183311cda4df9e1b65f2b363e0b806bff914_480x360.jpg?lang=en', 'expected_hash' => 'ff47c99c9eb95e3d6c4b986b18991f22', 'name' => __( 'Custom Language', 'video-thumbnails' ) ), ); } } ?>