mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Add a return value to wp_register_script() and wp_register_style() which matches the return value of WP_Dependencies::add().
Props katzwebdesign, pareshradadiya, DrewAPicture. Fixes #31126 git-svn-id: https://develop.svn.wordpress.org/trunk@32483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -155,4 +155,15 @@ class Tests_Dependencies_Scripts extends WP_UnitTestCase {
|
||||
// No scripts left to print
|
||||
$this->assertEquals( '', get_echo( 'wp_print_scripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing 'wp_register_script' return boolean success/failure value.
|
||||
*
|
||||
* @ticket 31126
|
||||
*/
|
||||
function test_wp_register_script() {
|
||||
$this->assertTrue( wp_register_script( 'duplicate-handler', 'http://example.com' ) );
|
||||
$this->assertFalse( wp_register_script( 'duplicate-handler', 'http://example.com' ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -229,4 +229,14 @@ CSS;
|
||||
$this->assertEquals( $expected, get_echo( 'wp_print_styles' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing 'wp_register_style' return boolean success/failure value.
|
||||
*
|
||||
* @ticket 31126
|
||||
*/
|
||||
function test_wp_register_style(){
|
||||
$this->assertTrue( wp_register_style( 'duplicate-handler', 'http://example.com' ) );
|
||||
$this->assertFalse( wp_register_style( 'duplicate-handler', 'http://example.com' ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user