Make WordPress Core

Changeset 61526


Ignore:
Timestamp:
01/26/2026 01:21:56 PM (8 months ago)
Author:
jonsurrell
Message:

Build/Test Tools: Clean obsolete non-HTML5 tests.

Support for non-HTML5 scripts was removed in [61415]. Removes obsolete tests and references to the non-HTML5 script behaviors including CDATA wrappers and type attributes.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/10740.

Follow-up to [61415].

Props jonsurrell, westonruter, mukesh27.
Fixes #64442.

Location:
trunk/tests/phpunit/tests/dependencies
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r61519 r61526  
    18771877
    18781878                $this->assertEqualHTML( $expected, $print_scripts, '<body>', 'Scripts are being incorrectly concatenated when a main script is registered as deferred after other blocking scripts are registered. Deferred scripts should not be part of the script concat loader query string. ' );
    1879         }
    1880 
    1881         /**
    1882          * @ticket 42804
    1883          */
    1884         public function test_wp_enqueue_script_with_html5_support_does_not_contain_type_attribute() {
    1885                 global $wp_version;
    1886 
    1887                 $GLOBALS['wp_scripts']                  = new WP_Scripts();
    1888                 $GLOBALS['wp_scripts']->default_version = get_bloginfo( 'version' );
    1889 
    1890                 wp_enqueue_script( 'empty-deps-no-version', 'example.com' );
    1891 
    1892                 $expected = "<script src='http://example.com?ver={$wp_version}' id='empty-deps-no-version-js'></script>\n";
    1893 
    1894                 $this->assertEqualHTML( $expected, get_echo( 'wp_print_scripts' ) );
    18951879        }
    18961880
  • trunk/tests/phpunit/tests/dependencies/wpLocalizeScript.php

    r60719 r61526  
    4747         */
    4848        public function test_wp_localize_script_outputs_safe_json() {
    49                 add_theme_support( 'html5', array( 'script' ) );
    50 
    5149                $path     = '/test.js';
    5250                $base_url = site_url( $path );
  • trunk/tests/phpunit/tests/dependencies/wpScriptTag.php

    r61482 r61526  
    1010
    1111        public function get_script_tag_type_set() {
    12                 add_theme_support( 'html5', array( 'script' ) );
    13 
    1412                $this->assertEqualHTML(
    1513                        '<script src="https://localhost/PATH/FILE.js" type="application/javascript" nomodule></script>' . "\n",
    … …  
    2321                        )
    2422                );
    25 
    26                 remove_theme_support( 'html5' );
    27 
    28                 $this->assertEqualHTML(
    29                         '<script src="https://localhost/PATH/FILE.js" type="application/javascript" nomodule></script>' . "\n",
    30                         wp_get_script_tag(
    31                                 array(
    32                                         'src'      => 'https://localhost/PATH/FILE.js',
    33                                         'type'     => 'application/javascript',
    34                                         'async'    => false,
    35                                         'nomodule' => true,
    36                                 )
    37                         )
    38                 );
    3923        }
    4024
    … …  
    4327         */
    4428        public function test_get_script_tag_type_not_set() {
    45                 add_theme_support( 'html5', array( 'script' ) );
    46 
    4729                $this->assertEqualHTML(
    4830                        '<script src="https://localhost/PATH/FILE.js" nomodule></script>' . "\n",
    … …  
    5537                        )
    5638                );
    57 
    58                 remove_theme_support( 'html5' );
    5939        }
    6040
    … …  
    7353                );
    7454
    75                 add_theme_support( 'html5', array( 'script' ) );
    76 
    7755                $attributes = array(
    7856                        'src'      => 'https://localhost/PATH/FILE.js',
    … …  
    8058                        'nomodule' => true,
    8159                );
    82 
    83                 $this->assertEqualHTML(
    84                         wp_get_script_tag( $attributes ),
    85                         get_echo(
    86                                 'wp_print_script_tag',
    87                                 array( $attributes )
    88                         )
    89                 );
    90 
    91                 remove_theme_support( 'html5' );
    9260
    9361                $this->assertEqualHTML(
Note: See TracChangeset for help on using the changeset viewer.