Changeset 52010 for trunk/tests/phpunit/tests/widgets/wpWidgetText.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/widgets/wpWidgetText.php
r51493 r52010 34 34 * @global WP_Customize_Manager $wp_customize 35 35 */ 36 function clean_up_global_scope() {36 public function clean_up_global_scope() { 37 37 global $wp_scripts, $wp_styles, $wp_customize; 38 38 parent::clean_up_global_scope(); … … 47 47 * @covers WP_Widget_Text::__construct 48 48 */ 49 function test_construct() {49 public function test_construct() { 50 50 $widget = new WP_Widget_Text(); 51 51 $this->assertSame( 'text', $widget->id_base ); … … 61 61 * @covers WP_Widget_Text::_register 62 62 */ 63 function test__register() {63 public function test__register() { 64 64 set_current_screen( 'widgets.php' ); 65 65 $widget = new WP_Widget_Text(); … … 79 79 * @covers WP_Widget_Text::_register 80 80 */ 81 function test__register_in_customize_preview() {81 public function test__register_in_customize_preview() { 82 82 global $wp_customize; 83 83 wp_set_current_user( … … 108 108 * @covers WP_Widget_Text::enqueue_preview_scripts 109 109 */ 110 function test_enqueue_preview_scripts() {110 public function test_enqueue_preview_scripts() { 111 111 global $wp_scripts, $wp_styles; 112 112 $wp_scripts = null; … … 130 130 * @covers WP_Widget_Text::widget 131 131 */ 132 function test_widget() {132 public function test_widget() { 133 133 $widget = new WP_Widget_Text(); 134 134 $text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Praesent ut turpis consequat lorem volutpat bibendum vitae vitae ante."; … … 303 303 * @return string Shortcode content. 304 304 */ 305 function do_example_shortcode() {305 public function do_example_shortcode() { 306 306 $this->post_during_shortcode = get_post(); 307 307 $this->shortcode_render_count++; … … 314 314 * @covers WP_Widget_Text::widget 315 315 */ 316 function test_widget_shortcodes() {316 public function test_widget_shortcodes() { 317 317 global $post; 318 318 $post_id = $this->factory()->post->create(); … … 439 439 * @return string Widget text. 440 440 */ 441 function filter_widget_text( $widget_text, $instance, $widget ) {441 public function filter_widget_text( $widget_text, $instance, $widget ) { 442 442 $this->widget_text_args = func_get_args(); 443 443 … … 454 454 * @return string Widget content. 455 455 */ 456 function filter_widget_text_content( $widget_text, $instance, $widget ) {456 public function filter_widget_text_content( $widget_text, $instance, $widget ) { 457 457 $this->widget_text_content_args = func_get_args(); 458 458 … … 466 466 * @covers WP_Widget_Text::is_legacy_instance 467 467 */ 468 function test_is_legacy_instance() {468 public function test_is_legacy_instance() { 469 469 $widget = new WP_Widget_Text(); 470 470 $base_instance = array( … … 631 631 * @covers WP_Widget_Text::form 632 632 */ 633 function test_form() {633 public function test_form() { 634 634 add_filter( 'user_can_richedit', '__return_true' ); 635 635 $widget = new WP_Widget_Text(); … … 707 707 * @covers WP_Widget_Text::update 708 708 */ 709 function test_update() {709 public function test_update() { 710 710 $widget = new WP_Widget_Text(); 711 711 $instance = array( … … 756 756 * @covers WP_Widget_Text::update 757 757 */ 758 function test_update_legacy() {758 public function test_update_legacy() { 759 759 $widget = new WP_Widget_Text(); 760 760 … … 954 954 * @return array Caps. 955 955 */ 956 function grant_unfiltered_html_cap( $caps, $cap ) {956 public function grant_unfiltered_html_cap( $caps, $cap ) { 957 957 if ( 'unfiltered_html' === $cap ) { 958 958 $caps = array_diff( $caps, array( 'do_not_allow' ) ); … … 969 969 * @return array Caps. 970 970 */ 971 function revoke_unfiltered_html_cap( $caps, $cap ) {971 public function revoke_unfiltered_html_cap( $caps, $cap ) { 972 972 if ( 'unfiltered_html' === $cap ) { 973 973 $caps = array_diff( $caps, array( 'unfiltered_html' ) ); … … 982 982 * @covers WP_Widget_Text::enqueue_admin_scripts 983 983 */ 984 function test_enqueue_admin_scripts() {984 public function test_enqueue_admin_scripts() { 985 985 set_current_screen( 'widgets.php' ); 986 986 $widget = new WP_Widget_Text(); … … 995 995 * @covers WP_Widget_Text::render_control_template_scripts 996 996 */ 997 function test_render_control_template_scripts() {997 public function test_render_control_template_scripts() { 998 998 ob_start(); 999 999 WP_Widget_Text::render_control_template_scripts(); … … 1008 1008 * @ticket 46421 1009 1009 */ 1010 function test_render_links_with_target() {1010 public function test_render_links_with_target() { 1011 1011 $widget = new WP_Widget_Text(); 1012 1012 … … 1035 1035 * @ticket 46421 1036 1036 */ 1037 function test_render_links_without_target() {1037 public function test_render_links_without_target() { 1038 1038 $widget = new WP_Widget_Text(); 1039 1039
Note: See TracChangeset
for help on using the changeset viewer.