Changeset 60279 for trunk/tests/phpunit/tests/customize/widgets.php
- Timestamp:
- 06/05/2025 08:43:08 AM (9 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/customize/widgets.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/customize/widgets.php
r60253 r60279 873 873 $this->manager->widgets->remove_prepreview_filters(); 874 874 } 875 876 /** 877 * Test that output_widget_control_templates() works without sidebars. 878 * This test verifies that the fix for accessing panel title works correctly 879 * when no sidebars are registered or the widgets panel doesn't exist. 880 * 881 * @ticket 63151 882 * 883 * @covers WP_Customize_Widgets::output_widget_control_templates 884 */ 885 public function test_output_widget_control_templates_without_sidebars() { 886 global $wp_registered_sidebars; 887 888 $original_sidebars = $wp_registered_sidebars; 889 $wp_registered_sidebars = array(); 890 $manager = new WP_Customize_Manager(); 891 $widgets = new WP_Customize_Widgets( $manager ); 892 893 if ( $manager->get_panel( 'widgets' ) ) { 894 $manager->remove_panel( 'widgets' ); 895 } 896 897 ob_start(); 898 899 $widgets->output_widget_control_templates(); 900 901 $output = ob_get_clean(); 902 $wp_registered_sidebars = $original_sidebars; 903 904 $this->assertStringNotContainsString( 'Warning', $output, 'Failed asserting that the output does not contain "Warning".' ); 905 $this->assertStringNotContainsString( 'Notice', $output, 'Failed asserting that the output does not contain "Notice".' ); 906 $this->assertStringNotContainsString( 'Error', $output, 'Failed asserting that the output does not contain "Error".' ); 907 908 // Check that the output contains expected widget controls HTML. 909 $this->assertStringContainsString( 'id="widgets-left"', $output, 'Failed asserting that the output contains "id=widgets-left".' ); 910 $this->assertStringContainsString( 'id="available-widgets"', $output, 'Failed asserting that the output contains "id=available-widgets".' ); 911 $this->assertStringNotContainsString( 'id="accordion-panel-widgets"', $output, 'Failed asserting that the output does not contain "id=accordion-panel-widgets".' ); 912 } 875 913 }
Note: See TracChangeset
for help on using the changeset viewer.