construct_info_retrieval_error( $request, $response ); } else { $result = json_decode( $response['body'] ); $result = $result->data->url; $high_res = str_replace( '_t.jpg', '_b.jpg', $result); if ( $high_res != $result ) { $response = wp_remote_head( $high_res ); if ( !is_wp_error( $response ) && $response['response']['code'] == '200' ) { $result = $high_res; } } } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => '', 'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/p160x160/50796_2560034672650_2560032632599_65313_313_b.jpg?oh=e8c767b1efafa6d8a4b672bad7be38d6&oe=55364081&__gda__=1428807476_a4d83140019b11ad602f2ef9960a364e', 'expected_hash' => '6b033d8f16dbf273048c5771d32ede64', 'name' => __( 'Flash Embed', 'video-thumbnails' ) ), array( 'markup' => '', 'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/v/t15.0-10/p160x160/50796_2560034672650_2560032632599_65313_313_b.jpg?oh=e8c767b1efafa6d8a4b672bad7be38d6&oe=55364081&__gda__=1428807476_a4d83140019b11ad602f2ef9960a364e', 'expected_hash' => '6b033d8f16dbf273048c5771d32ede64', 'name' => __( 'iFrame Embed', 'video-thumbnails' ) ), array( 'markup' => '
Post by Peter Jackson.
', 'expected' => 'https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xfa1/v/t15.0-10/p128x128/244423_10150326375786807_10150326323406807_4366_759_b.jpg?oh=013ce21bb54de51c383071598b269a91&oe=552CD270&__gda__=1428479462_339647870ec32227c391e98000935aec', 'expected_hash' => '184d20db21ac8edef9c9cee291be5ee6', 'name' => __( 'FBML Embed', 'video-thumbnails' ) ), ); } } ?>