From 548a18059c5caf7eed9270c8ec5a5422ee39a9df Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 17 Feb 2016 19:52:42 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/dependencies/scripts.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/phpunit/tests/dependencies/scripts.php b/tests/phpunit/tests/dependencies/scripts.php index 0624b594b2..aefce46f75 100644 --- a/tests/phpunit/tests/dependencies/scripts.php +++ b/tests/phpunit/tests/dependencies/scripts.php @@ -182,4 +182,21 @@ class Tests_Dependencies_Scripts extends WP_UnitTestCase { $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 ); + } }