mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 20:24:26 +00:00
Script Loader: Ignore deregistered dependencies in wp_dependencies_unique_hosts().
Prevents a PHP warning when a handle of a deregistered dependency is still in the queue. Fixes #37502. git-svn-id: https://develop.svn.wordpress.org/trunk@38174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -163,4 +163,17 @@ class Tests_WP_Resource_Hints extends WP_UnitTestCase {
|
||||
$this->assertEquals( $expected, $actual );
|
||||
$this->assertNotContains( $unexpected, $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 37502
|
||||
*/
|
||||
function test_deregistered_scripts_are_ignored() {
|
||||
$expected = "<link rel='dns-prefetch' href='//s.w.org'>\n";
|
||||
|
||||
wp_enqueue_script( 'test-script', 'http://example.org/script.js' );
|
||||
wp_deregister_script( 'test-script' );
|
||||
|
||||
$actual = get_echo( 'wp_resource_hints' );
|
||||
$this->assertEquals( $expected, $actual );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user