Tests: Add a test for testing `wp_enqueue_script()` with an alias handle in the footer.

Props kovshenin.
See #35643.

git-svn-id: https://develop.svn.wordpress.org/trunk@36559 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-02-17 19:52:42 +00:00
parent 1d19617606
commit 548a18059c
1 changed files with 17 additions and 0 deletions

View File

@ -182,4 +182,21 @@ class Tests_Dependencies_Scripts extends WP_UnitTestCase {
$this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) ); $this->assertEquals( $expected, get_echo( 'wp_print_scripts' ) );
} }
/**
* @ticket 35643
*/
function test_wp_enqueue_script_footer_alias() {
wp_register_script( 'foo', false, array( 'bar', 'baz' ), '1.0', true );
wp_register_script( 'bar', home_url( 'bar.js' ), array(), '1.0', true );
wp_register_script( 'baz', home_url( 'baz.js' ), array(), '1.0', true );
wp_enqueue_script( 'foo' );
$header = get_echo( 'wp_print_head_scripts' );
$footer = get_echo( 'wp_print_footer_scripts' );
$this->assertEmpty( $header );
$this->assertContains( home_url( 'bar.js' ), $footer );
$this->assertContains( home_url( 'baz.js' ), $footer );
}
} }