mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 18:24:31 +00:00
Widgets: Fix extensibility of Text widgets so that JS logic will initialize on subclassed widgets.
Amends [40631]. See #35243. Fixes #41540. git-svn-id: https://develop.svn.wordpress.org/trunk@41245 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -64,7 +64,8 @@ class Test_WP_Widget_Text extends WP_UnitTestCase {
|
||||
$widget->_register();
|
||||
|
||||
$this->assertEquals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );
|
||||
$this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( $widget, 'render_control_template_scripts' ) ) );
|
||||
$this->assertEquals( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) ) );
|
||||
$this->assertContains( 'wp.textWidgets.idBases.push( "text" );', wp_scripts()->registered['text-widgets']->extra['after'] );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -745,10 +746,8 @@ class Test_WP_Widget_Text extends WP_UnitTestCase {
|
||||
* @covers WP_Widget_Text::render_control_template_scripts
|
||||
*/
|
||||
function test_render_control_template_scripts() {
|
||||
$widget = new WP_Widget_Text();
|
||||
|
||||
ob_start();
|
||||
$widget->render_control_template_scripts();
|
||||
WP_Widget_Text::render_control_template_scripts();
|
||||
$output = ob_get_clean();
|
||||
|
||||
$this->assertContains( '<script type="text/html" id="tmpl-widget-text-control-fields">', $output );
|
||||
|
||||
Reference in New Issue
Block a user