- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/widgets/custom-html-widget.php
r46586 r48937 48 48 public function test_construct() { 49 49 $widget = new WP_Widget_Custom_HTML(); 50 $this->assert Equals( 'custom_html', $widget->id_base );51 $this->assert Equals( 'widget_custom_html', $widget->widget_options['classname'] );52 $this->assert Equals( 400, $widget->control_options['width'] );53 $this->assert Equals( 350, $widget->control_options['height'] );50 $this->assertSame( 'custom_html', $widget->id_base ); 51 $this->assertSame( 'widget_custom_html', $widget->widget_options['classname'] ); 52 $this->assertSame( 400, $widget->control_options['width'] ); 53 $this->assertSame( 350, $widget->control_options['height'] ); 54 54 $this->assertTrue( $widget->widget_options['customize_selective_refresh'] ); 55 55 } … … 65 65 $widget->_register(); 66 66 67 $this->assert Equals( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) );68 $this->assert Equals( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) ) );69 $this->assert Equals( 10, has_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) ) );67 $this->assertSame( 10, has_action( 'admin_print_scripts-widgets.php', array( $widget, 'enqueue_admin_scripts' ) ) ); 68 $this->assertSame( 10, has_action( 'admin_footer-widgets.php', array( 'WP_Widget_Custom_HTML', 'render_control_template_scripts' ) ) ); 69 $this->assertSame( 10, has_action( 'admin_head-widgets.php', array( 'WP_Widget_Custom_HTML', 'add_help_text' ) ) ); 70 70 $this->assertContains( 'wp.customHtmlWidgets.idBases.push( "custom_html" );', wp_scripts()->registered['custom-html-widgets']->extra['after'] ); 71 71 } … … 118 118 $this->assertNotContains( '<br>', $output ); 119 119 $this->assertNotContains( '</u>', $output ); 120 $this->assert Equals( $text_widget_instance, $this->widget_text_args[1] );121 $this->assert Equals( $instance, $this->widget_custom_html_content_args[1] );120 $this->assertSame( $text_widget_instance, $this->widget_text_args[1] ); 121 $this->assertSame( $instance, $this->widget_custom_html_content_args[1] ); 122 122 $this->assertSame( $widget, $this->widget_text_args[2] ); 123 123 $this->assertSame( $widget, $this->widget_custom_html_content_args[2] ); … … 186 186 ); 187 187 $result = $widget->update( $instance, array() ); 188 $this->assert Equals( $result, $expected );188 $this->assertSame( $result, $expected ); 189 189 190 190 // Make sure KSES is applying as expected. … … 194 194 $expected['content'] = $instance['content']; 195 195 $result = $widget->update( $instance, array() ); 196 $this->assert Equals( $result, $expected );196 $this->assertSame( $result, $expected ); 197 197 remove_filter( 'map_meta_cap', array( $this, 'grant_unfiltered_html_cap' ) ); 198 198 … … 202 202 $expected['content'] = wp_kses_post( $instance['content'] ); 203 203 $result = $widget->update( $instance, array() ); 204 $this->assert Equals( $result, $expected );204 $this->assertSame( $result, $expected ); 205 205 remove_filter( 'map_meta_cap', array( $this, 'revoke_unfiltered_html_cap' ), 10 ); 206 206 }
Note: See TracChangeset
for help on using the changeset viewer.