mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 11:14:36 +00:00
wp_script_is( ..., 'enqueued' ) needs to check dependencies recursively - a single item's dependencies may only be a subset of the full dependency tree. Adds a new method on WP_Dependencies called ->recurse_deps().
Adds unit test. Props wonderboymusic, SergeyBiryukov, mikejolley. Fixes #28404. git-svn-id: https://develop.svn.wordpress.org/trunk@29252 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -69,4 +69,16 @@ class Tests_Dependencies_jQuery extends WP_UnitTestCase {
|
||||
$contents = trim( file_get_contents( ABSPATH . WPINC . '/js/jquery/jquery.js' ) );
|
||||
$this->assertFalse( strpos( $contents, 'sourceMappingURL' ), 'Presence of sourceMappingURL' );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 28404
|
||||
*/
|
||||
function test_wp_script_is_dep_enqueued() {
|
||||
wp_enqueue_script( 'jquery-ui-accordion' );
|
||||
|
||||
$this->assertTrue( wp_script_is( 'jquery', 'enqueued' ) );
|
||||
$this->assertFalse( wp_script_is( 'underscore', 'enqueued' ) );
|
||||
|
||||
unset( $GLOBALS['wp_scripts'] );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user