Skip to content

Commit 14feeb5

Browse files
committed
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 WordPress#10740. Follow-up to [61415]. Props jonsurrell, westonruter, mukesh27. Fixes #64442. git-svn-id: https://develop.svn.wordpress.org/trunk@61526 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0e73699 commit 14feeb5

3 files changed

Lines changed: 0 additions & 50 deletions

File tree

tests/phpunit/tests/dependencies/scripts.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1878,22 +1878,6 @@ public function test_concatenate_with_blocking_script_before_and_after_script_wi
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. ' );
18791879
}
18801880

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' ) );
1895-
}
1896-
18971881
/**
18981882
* Test the different protocol references in wp_enqueue_script
18991883
*

tests/phpunit/tests/dependencies/wpLocalizeScript.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public function test_wp_localize_script_works_before_enqueue_script() {
4646
* @covers ::wp_localize_script
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 );
5351

tests/phpunit/tests/dependencies/wpScriptTag.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
class Tests_Dependencies_wpScriptTag extends WP_UnitTestCase {
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",
1614
wp_get_script_tag(
@@ -22,28 +20,12 @@ public function get_script_tag_type_set() {
2220
)
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

4125
/**
4226
* @covers ::wp_get_script_tag
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",
4931
wp_get_script_tag(
@@ -54,8 +36,6 @@ public function test_get_script_tag_type_not_set() {
5436
)
5537
)
5638
);
57-
58-
remove_theme_support( 'html5' );
5939
}
6040

6141
/**
@@ -72,8 +52,6 @@ static function ( $attributes ) {
7252
}
7353
);
7454

75-
add_theme_support( 'html5', array( 'script' ) );
76-
7755
$attributes = array(
7856
'src' => 'https://localhost/PATH/FILE.js',
7957
'id' => 'utils-js-extra',
@@ -87,16 +65,6 @@ static function ( $attributes ) {
8765
array( $attributes )
8866
)
8967
);
90-
91-
remove_theme_support( 'html5' );
92-
93-
$this->assertEqualHTML(
94-
wp_get_script_tag( $attributes ),
95-
get_echo(
96-
'wp_print_script_tag',
97-
array( $attributes )
98-
)
99-
);
10068
}
10169

10270
/**

0 commit comments

Comments
 (0)