Make WordPress Core


Ignore:
Timestamp:
12/19/2025 11:16:42 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Tests: Update scripts tests to use semantic HTML comparison.

This aims to make the tests more robust.

Follow-up to [50167], [60295], [61391], [61392].

Props jonsurrell.
See #64225.

File:
1 edited

Legend:

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

    r52010 r61394  
    1212                add_theme_support( 'html5', array( 'script' ) );
    1313
    14                 $this->assertSame(
     14                $this->assertEqualHTML(
    1515                        '<script src="https://localhost/PATH/FILE.js" type="application/javascript" nomodule></script>' . "\n",
    1616                        wp_get_script_tag(
    … …  
    2626                remove_theme_support( 'html5' );
    2727
    28                 $this->assertSame(
     28                $this->assertEqualHTML(
    2929                        '<script src="https://localhost/PATH/FILE.js" type="application/javascript" nomodule></script>' . "\n",
    3030                        wp_get_script_tag(
    … …  
    4545                add_theme_support( 'html5', array( 'script' ) );
    4646
    47                 $this->assertSame(
     47                $this->assertEqualHTML(
    4848                        '<script src="https://localhost/PATH/FILE.js" nomodule></script>' . "\n",
    4949                        wp_get_script_tag(
    … …  
    8181                );
    8282
    83                 $this->assertSame(
     83                $this->assertEqualHTML(
    8484                        wp_get_script_tag( $attributes ),
    8585                        get_echo(
    … …  
    9191                remove_theme_support( 'html5' );
    9292
    93                 $this->assertSame(
     93                $this->assertEqualHTML(
    9494                        wp_get_script_tag( $attributes ),
    9595                        get_echo(
Note: See TracChangeset for help on using the changeset viewer.