Make WordPress Core


Ignore:
Timestamp:
02/17/2016 07:52:42 PM (9 years ago)
Author:
ocean90
Message:

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

Props kovshenin.
See #35643.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/dependencies/scripts.php

    r36550 r36559  
    183183    }
    184184
     185    /**
     186     * @ticket 35643
     187     */
     188    function test_wp_enqueue_script_footer_alias() {
     189        wp_register_script( 'foo', false, array( 'bar', 'baz' ), '1.0', true );
     190        wp_register_script( 'bar', home_url( 'bar.js' ), array(), '1.0', true );
     191        wp_register_script( 'baz', home_url( 'baz.js' ), array(), '1.0', true );
     192
     193        wp_enqueue_script( 'foo' );
     194
     195        $header = get_echo( 'wp_print_head_scripts' );
     196        $footer = get_echo( 'wp_print_footer_scripts' );
     197
     198        $this->assertEmpty( $header );
     199        $this->assertContains( home_url( 'bar.js' ), $footer );
     200        $this->assertContains( home_url( 'baz.js' ), $footer );
     201    }
    185202}
Note: See TracChangeset for help on using the changeset viewer.