Changeset 46283 for trunk/tests/phpunit/tests/customize/widgets.php
- Timestamp:
- 09/23/2019 11:16:59 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/widgets.php
r46282 r46283 33 33 unset( $GLOBALS['_wp_sidebars_widgets'] ); // clear out cache set by wp_get_sidebars_widgets() 34 34 $sidebars_widgets = wp_get_sidebars_widgets(); 35 $this->assertEqualSets( array( 'wp_inactive_widgets', ' footer-one', 'footer-two' ), array_keys( wp_get_sidebars_widgets() ) );36 $this->assertContains( 'search-2', $sidebars_widgets[' footer-one'] );37 $this->assertContains( 'categories-2', $sidebars_widgets[' footer-two'] );35 $this->assertEqualSets( array( 'wp_inactive_widgets', 'sidebar-1', 'sidebar-2' ), array_keys( wp_get_sidebars_widgets() ) ); 36 $this->assertContains( 'search-2', $sidebars_widgets['sidebar-1'] ); 37 $this->assertContains( 'categories-2', $sidebars_widgets['sidebar-2'] ); 38 38 $this->assertArrayHasKey( 2, get_option( 'widget_search' ) ); 39 39 $widget_categories = get_option( 'widget_categories' ); … … 102 102 */ 103 103 function test_customize_register_with_deleted_sidebars() { 104 $sidebar_id = ' footer-one';104 $sidebar_id = 'sidebar-1'; 105 105 delete_option( 'sidebars_widgets' ); 106 106 register_sidebar( array( 'id' => $sidebar_id ) ); … … 312 312 'sanitize_js_callback' => array( $this->manager->widgets, 'sanitize_sidebar_widgets_js_instance' ), 313 313 ); 314 $args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[ footer-one]' );314 $args = $this->manager->widgets->get_setting_args( 'sidebars_widgets[sidebar-1]' ); 315 315 foreach ( $default_args as $key => $default_value ) { 316 316 $this->assertEquals( $default_value, $args[ $key ] ); 317 317 } 318 $this->assertEquals( 'SIDEBARS_WIDGETS[ FOOTER-ONE]', $args['uppercase_id_set_by_filter'] );318 $this->assertEquals( 'SIDEBARS_WIDGETS[SIDEBAR-1]', $args['uppercase_id_set_by_filter'] ); 319 319 320 320 $override_args = array( … … 654 654 $this->assertFalse( $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'non-existing' ) ) ); 655 655 656 $output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => ' footer-one' ) );656 $output = $this->manager->widgets->render_widget_partial( $partial, array( 'sidebar_id' => 'sidebar-1' ) ); 657 657 658 658 $this->assertEquals( 1, substr_count( $output, 'data-customize-partial-id' ) );
Note: See TracChangeset
for help on using the changeset viewer.