construct_info_retrieval_error( $request, $response ); } else { $doc = new DOMDocument(); @$doc->loadHTML( $response['body'] ); $metas = $doc->getElementsByTagName( 'img' ); for ( $i = 0; $i < $metas->length; $i++ ) { $meta = $metas->item( $i ); if ( $meta->getAttribute( 'id' ) == 'player_thumb' ) { $result = $meta->getAttribute( 'src' ); break; } } } return $result; } // Test cases public static function get_test_cases() { return array( array( 'markup' => '', 'expected' => 'http://cs540302.vk.me/u220943440/video/l_afc9770f.jpg', 'expected_hash' => 'fd8c2af4ad5cd4e55afe129d80b42d8b', 'name' => __( 'iFrame Embed', 'video-thumbnails' ) ), ); } } ?>