@@ -287,89 +287,6 @@ public function rewritePlaceholdersProvider() {
287287 ];
288288 }
289289
290- /**
291- * @covers StaticHTMLOutput\HTMLProcessor::__construct
292- * @covers StaticHTMLOutput\HTMLProcessor::rewriteUnchangedPlaceholderURLs
293- * @dataProvider unchangedURLsProvider
294- */
295- public function testRewritingRemainingPlaceholders (
296- $ placeholder_url ,
297- $ destination_url ,
298- $ rewrite_rules ,
299- $ processed_html ,
300- $ exp_result
301- ) {
302-
303- $ html_processor = new HTMLProcessor (
304- false , // $remove_conditional_head_comments = false
305- false , // $remove_html_comments = false
306- false , // $remove_wp_links = false
307- false , // $remove_wp_meta = false
308- '' , // $rewrite_rules = false
309- '' , // $base_url
310- '' , // $selected_deployment_option = 'folder'
311- '' , // $wp_site_url
312- '' // $wp_uploads_path
313- );
314-
315- $ this ->assertEquals (
316- $ exp_result ,
317- $ html_processor ->rewriteUnchangedPlaceholderURLs (
318- $ processed_html ,
319- $ placeholder_url ,
320- $ destination_url ,
321- $ rewrite_rules
322- )
323- );
324- }
325-
326- public function unchangedURLsProvider () {
327- return [
328- 'http destination URL with trailing slash and trailing chars ' => [
329- 'http://PLACEHOLDER.wpsho ' ,
330- 'https://somedomain.com ' ,
331- '' ,
332- '<a href="http://PLACEHOLDER.wpsho/banana.jpg">Link to some file</a> ' ,
333- '<a href="https://somedomain.com/banana.jpg">Link to some file</a> ' ,
334- ],
335- 'http destination URL with trailing slash ' => [
336- 'http://PLACEHOLDER.wpsho ' ,
337- 'https://somedomain.com ' ,
338- '' ,
339- '<a href="http://PLACEHOLDER.wpsho/">Link to some file</a> ' ,
340- '<a href="https://somedomain.com/">Link to some file</a> ' ,
341- ],
342- 'http destination URL without trailing slash ' => [
343- 'http://PLACEHOLDER.wpsho ' ,
344- 'https://somedomain.com ' ,
345- '' ,
346- '<a href="http://PLACEHOLDER.wpsho">Link to some file</a> ' ,
347- '<a href="https://somedomain.com">Link to some file</a> ' ,
348- ],
349- 'https destination URL with trailing slash and trailing chars ' => [
350- 'http://PLACEHOLDER.wpsho ' ,
351- 'https://somedomain.com ' ,
352- '' ,
353- '<a href="http://PLACEHOLDER.wpsho/banana.jpg">Link to some file</a> ' ,
354- '<a href="https://somedomain.com/banana.jpg">Link to some file</a> ' ,
355- ],
356- 'https destination URL with trailing slash ' => [
357- 'http://PLACEHOLDER.wpsho ' ,
358- 'https://somedomain.com ' ,
359- '' ,
360- '<a href="http://PLACEHOLDER.wpsho/">Link to some file</a> ' ,
361- '<a href="https://somedomain.com/">Link to some file</a> ' ,
362- ],
363- 'https destination URL without trailing slash ' => [
364- 'http://PLACEHOLDER.wpsho ' ,
365- 'https://somedomain.com ' ,
366- '' ,
367- '<a href="http://PLACEHOLDER.wpsho">Link to some file</a> ' ,
368- '<a href="https://somedomain.com">Link to some file</a> ' ,
369- ],
370- ];
371- }
372-
373290 /**
374291 * @covers StaticHTMLOutput\HTMLProcessor::__construct
375292 * @covers StaticHTMLOutput\HTMLProcessor::detectEscapedSiteURLs
0 commit comments