Make WordPress Core

Ticket #44610: nocookie4-tests.patch

File nocookie4-tests.patch, 712 bytes (added by adakaleh, 4 years ago)

Adjust YT regex within a test

  • tests/phpunit/tests/oembed/WpEmbed.php

    diff --git a/tests/phpunit/tests/oembed/WpEmbed.php b/tests/phpunit/tests/oembed/WpEmbed.php
    index 239ea24d56..08e196a75a 100644
    a b class Tests_WP_Embed extends WP_UnitTestCase { 
    100100                $handlers = $GLOBALS['wp_embed']->handlers[10];
    101101
    102102                // Restore.
    103                 wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );
     103                wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube(?:-nocookie)?\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' );
    104104
    105105                $this->assertArrayNotHasKey( 'youtube_embed_url', $handlers );
    106106        }