Changeset 54889
- Timestamp:
- 11/29/2022 12:32:37 PM (23 months ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/wpCommentsListTable.php
r54215 r54889 11 11 protected $table; 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->table = _get_list_table( 'WP_Comments_List_Table', array( 'screen' => 'edit-comments' ) ); -
trunk/tests/phpunit/tests/admin/wpPostCommentsListTable.php
r54215 r54889 13 13 protected $table; 14 14 15 function set_up() {15 public function set_up() { 16 16 parent::set_up(); 17 17 $this->table = _get_list_table( 'WP_Post_Comments_List_Table', array( 'screen' => 'edit-post-comments' ) ); -
trunk/tests/phpunit/tests/admin/wpPostsListTable.php
r54663 r54889 15 15 protected $table; 16 16 17 function set_up() {17 public function set_up() { 18 18 parent::set_up(); 19 19 $this->table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => 'edit-page' ) ); … … 80 80 * @covers WP_Posts_List_Table::set_hierarchical_display 81 81 */ 82 function test_list_hierarchical_pages_first_page() {82 public function test_list_hierarchical_pages_first_page() { 83 83 $this->_test_list_hierarchical_page( 84 84 array( … … 99 99 * @covers WP_Posts_List_Table::set_hierarchical_display 100 100 */ 101 function test_list_hierarchical_pages_second_page() {101 public function test_list_hierarchical_pages_second_page() { 102 102 $this->_test_list_hierarchical_page( 103 103 array( … … 119 119 * @covers WP_Posts_List_Table::set_hierarchical_display 120 120 */ 121 function test_search_hierarchical_pages_first_page() {121 public function test_search_hierarchical_pages_first_page() { 122 122 $this->_test_list_hierarchical_page( 123 123 array( … … 139 139 * @covers WP_Posts_List_Table::set_hierarchical_display 140 140 */ 141 function test_search_hierarchical_pages_second_page() {141 public function test_search_hierarchical_pages_second_page() { 142 142 $this->_test_list_hierarchical_page( 143 143 array( … … 159 159 * @covers WP_Posts_List_Table::set_hierarchical_display 160 160 */ 161 function test_grandchildren_hierarchical_pages_first_page() {161 public function test_grandchildren_hierarchical_pages_first_page() { 162 162 // Page 6 is the first page with grandchildren. 163 163 $this->_test_list_hierarchical_page( … … 181 181 * @covers WP_Posts_List_Table::set_hierarchical_display 182 182 */ 183 function test_grandchildren_hierarchical_pages_second_page() {183 public function test_grandchildren_hierarchical_pages_second_page() { 184 184 // Page 7 is the second page with grandchildren. 185 185 $this->_test_list_hierarchical_page( … … 261 261 * @covers WP_Posts_List_Table::extra_tablenav 262 262 */ 263 function test_filter_button_should_not_be_shown_if_there_are_no_posts() {263 public function test_filter_button_should_not_be_shown_if_there_are_no_posts() { 264 264 // Set post type to a non-existent one. 265 265 $this->table->screen->post_type = 'foo'; … … 277 277 * @covers WP_Posts_List_Table::extra_tablenav 278 278 */ 279 function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() {279 public function test_months_dropdown_should_not_be_shown_if_there_are_no_posts() { 280 280 // Set post type to a non-existent one. 281 281 $this->table->screen->post_type = 'foo'; … … 293 293 * @covers WP_Posts_List_Table::extra_tablenav 294 294 */ 295 function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() {295 public function test_category_dropdown_should_not_be_shown_if_there_are_no_posts() { 296 296 // Set post type to a non-existent one. 297 297 $this->table->screen->post_type = 'foo'; -
trunk/tests/phpunit/tests/block-supports/border.php
r54211 r54889 11 11 private $test_block_name; 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->test_block_name = null; 16 16 } 17 17 18 function tear_down() {18 public function tear_down() { 19 19 unregister_block_type( $this->test_block_name ); 20 20 $this->test_block_name = null; … … 25 25 * @ticket 55505 26 26 */ 27 function test_border_color_slug_with_numbers_is_kebab_cased_properly() {27 public function test_border_color_slug_with_numbers_is_kebab_cased_properly() { 28 28 $this->test_block_name = 'test/border-color-slug-with-numbers-is-kebab-cased-properly'; 29 29 register_block_type( … … 74 74 * @ticket 55505 75 75 */ 76 function test_border_with_skipped_serialization_block_supports() {76 public function test_border_with_skipped_serialization_block_supports() { 77 77 $this->test_block_name = 'test/border-with-skipped-serialization-block-supports'; 78 78 register_block_type( … … 118 118 * @ticket 55505 119 119 */ 120 function test_radius_with_individual_skipped_serialization_block_supports() {120 public function test_radius_with_individual_skipped_serialization_block_supports() { 121 121 $this->test_block_name = 'test/radius-with-individual-skipped-serialization-block-supports'; 122 122 register_block_type( -
trunk/tests/phpunit/tests/block-supports/colors.php
r54211 r54889 11 11 private $test_block_name; 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->test_block_name = null; 16 16 } 17 17 18 function tear_down() {18 public function tear_down() { 19 19 unregister_block_type( $this->test_block_name ); 20 20 $this->test_block_name = null; … … 25 25 * @ticket 54337 26 26 */ 27 function test_color_slugs_with_numbers_are_kebab_cased_properly() {27 public function test_color_slugs_with_numbers_are_kebab_cased_properly() { 28 28 $this->test_block_name = 'test/color-slug-with-numbers'; 29 29 register_block_type( … … 69 69 * @ticket 55505 70 70 */ 71 function test_color_with_skipped_serialization_block_supports() {71 public function test_color_with_skipped_serialization_block_supports() { 72 72 $this->test_block_name = 'test/color-with-skipped-serialization-block-supports'; 73 73 register_block_type( … … 110 110 * @ticket 55505 111 111 */ 112 function test_gradient_with_individual_skipped_serialization_block_supports() {112 public function test_gradient_with_individual_skipped_serialization_block_supports() { 113 113 $this->test_block_name = 'test/gradient-with-individual-skipped-serialization-block-support'; 114 114 register_block_type( -
trunk/tests/phpunit/tests/block-supports/layout.php
r53916 r54889 33 33 private $orig_theme_dir; 34 34 35 function set_up() {35 public function set_up() { 36 36 parent::set_up(); 37 37 $this->theme_root = realpath( DIR_TESTDATA . '/themedir1' ); … … 51 51 } 52 52 53 function tear_down() {53 public function tear_down() { 54 54 $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; 55 55 … … 64 64 } 65 65 66 function filter_set_theme_root() {66 public function filter_set_theme_root() { 67 67 return $this->theme_root; 68 68 } … … 71 71 * @ticket 55505 72 72 */ 73 function test_outer_container_not_restored_for_non_aligned_image_block_with_non_themejson_theme() {73 public function test_outer_container_not_restored_for_non_aligned_image_block_with_non_themejson_theme() { 74 74 // The "default" theme doesn't have theme.json support. 75 75 switch_theme( 'default' ); … … 87 87 * @ticket 55505 88 88 */ 89 function test_outer_container_restored_for_aligned_image_block_with_non_themejson_theme() {89 public function test_outer_container_restored_for_aligned_image_block_with_non_themejson_theme() { 90 90 // The "default" theme doesn't have theme.json support. 91 91 switch_theme( 'default' ); … … 108 108 * @param string $expected The expected block image HTML. 109 109 */ 110 function test_additional_styles_moved_to_restored_outer_container_for_aligned_image_block_with_non_themejson_theme( $block_image_html, $expected ) {110 public function test_additional_styles_moved_to_restored_outer_container_for_aligned_image_block_with_non_themejson_theme( $block_image_html, $expected ) { 111 111 // The "default" theme doesn't have theme.json support. 112 112 switch_theme( 'default' ); … … 161 161 * @ticket 55505 162 162 */ 163 function test_outer_container_not_restored_for_aligned_image_block_with_themejson_theme() {163 public function test_outer_container_not_restored_for_aligned_image_block_with_themejson_theme() { 164 164 switch_theme( 'block-theme' ); 165 165 $block = array( -
trunk/tests/phpunit/tests/block-supports/spacing.php
r54211 r54889 11 11 private $test_block_name; 12 12 13 function set_up() {13 public function set_up() { 14 14 parent::set_up(); 15 15 $this->test_block_name = null; 16 16 } 17 17 18 function tear_down() {18 public function tear_down() { 19 19 unregister_block_type( $this->test_block_name ); 20 20 $this->test_block_name = null; … … 25 25 * @ticket 55505 26 26 */ 27 function test_spacing_style_is_applied() {27 public function test_spacing_style_is_applied() { 28 28 $this->test_block_name = 'test/spacing-style-is-applied'; 29 29 register_block_type( … … 73 73 * @ticket 55505 74 74 */ 75 function test_spacing_with_skipped_serialization_block_supports() {75 public function test_spacing_with_skipped_serialization_block_supports() { 76 76 $this->test_block_name = 'test/spacing-with-skipped-serialization-block-supports'; 77 77 register_block_type( … … 120 120 * @ticket 55505 121 121 */ 122 function test_margin_with_individual_skipped_serialization_block_supports() {122 public function test_margin_with_individual_skipped_serialization_block_supports() { 123 123 $this->test_block_name = 'test/margin-with-individual-skipped-serialization-block-supports'; 124 124 register_block_type( -
trunk/tests/phpunit/tests/block-supports/typography.php
r54823 r54889 24 24 private $orig_theme_dir; 25 25 26 function set_up() {26 public function set_up() { 27 27 parent::set_up(); 28 28 … … 49 49 * Unregisters block type after each test. 50 50 */ 51 function tear_down() {51 public function tear_down() { 52 52 // Restores the original theme directory setup. 53 53 $GLOBALS['wp_theme_directories'] = $this->orig_theme_dir; … … 69 69 * @covers ::wp_apply_typography_support 70 70 */ 71 function test_should_kebab_case_font_size_slug_with_numbers() {71 public function test_should_kebab_case_font_size_slug_with_numbers() { 72 72 $this->test_block_name = 'test/font-size-slug-with-numbers'; 73 73 register_block_type( … … 105 105 * @covers ::wp_apply_typography_support 106 106 */ 107 function test_should_generate_font_family_with_legacy_inline_styles_using_a_value() {107 public function test_should_generate_font_family_with_legacy_inline_styles_using_a_value() { 108 108 $this->test_block_name = 'test/font-family-with-inline-styles-using-value'; 109 109 register_block_type( … … 140 140 * @covers ::wp_apply_typography_support 141 141 */ 142 function test_should_skip_serialization_for_typography_block_supports() {142 public function test_should_skip_serialization_for_typography_block_supports() { 143 143 $this->test_block_name = 'test/typography-with-skipped-serialization-block-supports'; 144 144 register_block_type( … … 188 188 * @covers ::wp_apply_typography_support 189 189 */ 190 function test_should_skip_serialization_for_letter_spacing_block_supports() {190 public function test_should_skip_serialization_for_letter_spacing_block_supports() { 191 191 $this->test_block_name = 'test/letter-spacing-with-individual-skipped-serialization-block-supports'; 192 192 register_block_type( … … 226 226 * @covers ::wp_apply_typography_support 227 227 */ 228 function test_should_generate_css_var_for_font_family_with_legacy_inline_styles() {228 public function test_should_generate_css_var_for_font_family_with_legacy_inline_styles() { 229 229 $this->test_block_name = 'test/font-family-with-inline-styles-using-css-var'; 230 230 register_block_type( … … 261 261 * @covers ::wp_apply_typography_support 262 262 */ 263 function test_should_generate_classname_for_font_family() {263 public function test_should_generate_classname_for_font_family() { 264 264 $this->test_block_name = 'test/font-family-with-class'; 265 265 register_block_type( … … 309 309 * @param string $expected_output Expected output. 310 310 */ 311 function test_wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography, $expected_output ) {311 public function test_wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography, $expected_output ) { 312 312 $actual = wp_get_typography_font_size_value( $font_size_preset, $should_use_fluid_typography ); 313 313 -
trunk/tests/phpunit/tests/block-template-utils.php
r54860 r54889 132 132 * @covers ::_build_block_template_result_from_post 133 133 */ 134 function test_build_block_template_result_from_post_with_child_theme() {134 public function test_build_block_template_result_from_post_with_child_theme() { 135 135 switch_theme( 'block-theme-child' ); 136 136 … … 143 143 } 144 144 145 function test_build_block_template_result_from_file() {145 public function test_build_block_template_result_from_file() { 146 146 $template = _build_block_template_result_from_file( 147 147 array( … … 189 189 * @covers ::_build_block_template_result_from_file 190 190 */ 191 function test_build_block_template_result_from_file_with_child_theme() {191 public function test_build_block_template_result_from_file_with_child_theme() { 192 192 switch_theme( 'block-theme-child' ); 193 193 … … 204 204 } 205 205 206 function test_inject_theme_attribute_in_block_template_content() {206 public function test_inject_theme_attribute_in_block_template_content() { 207 207 $theme = get_stylesheet(); 208 208 $content_without_theme_attribute = '<!-- wp:template-part {"slug":"header","align":"full", "tagName":"header","className":"site-header"} /-->'; … … 250 250 * @dataProvider data_remove_theme_attribute_in_block_template_content 251 251 */ 252 function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) {252 public function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) { 253 253 $this->assertSame( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) ); 254 254 } 255 255 256 function data_remove_theme_attribute_in_block_template_content() {256 public function data_remove_theme_attribute_in_block_template_content() { 257 257 return array( 258 258 array( … … 280 280 * Should retrieve the template from the theme files. 281 281 */ 282 function test_get_block_template_from_file() {282 public function test_get_block_template_from_file() { 283 283 $id = get_stylesheet() . '//' . 'index'; 284 284 $template = get_block_template( $id, 'wp_template' ); … … 330 330 * Should flatten nested blocks 331 331 */ 332 function test_flatten_blocks() {332 public function test_flatten_blocks() { 333 333 $content_template_part_inside_group = '<!-- wp:group --><!-- wp:template-part {"slug":"header"} /--><!-- /wp:group -->'; 334 334 $blocks = parse_blocks( $content_template_part_inside_group ); … … 356 356 * @requires extension zip 357 357 */ 358 function test_wp_generate_block_templates_export_file() {358 public function test_wp_generate_block_templates_export_file() { 359 359 $filename = wp_generate_block_templates_export_file(); 360 360 $this->assertFileExists( $filename, 'zip file is created at the specified path' ); -
trunk/tests/phpunit/tests/block-template.php
r53093 r54889 29 29 } 30 30 31 function test_page_home_block_template_takes_precedence_over_less_specific_block_templates() {31 public function test_page_home_block_template_takes_precedence_over_less_specific_block_templates() { 32 32 global $_wp_current_template_content; 33 33 $type = 'page'; … … 42 42 } 43 43 44 function test_page_block_template_takes_precedence() {44 public function test_page_block_template_takes_precedence() { 45 45 global $_wp_current_template_content; 46 46 $type = 'page'; … … 55 55 } 56 56 57 function test_block_template_takes_precedence_over_equally_specific_php_template() {57 public function test_block_template_takes_precedence_over_equally_specific_php_template() { 58 58 global $_wp_current_template_content; 59 59 $type = 'index'; … … 72 72 * Covers https://github.com/WordPress/gutenberg/pull/29026. 73 73 */ 74 function test_more_specific_php_template_takes_precedence_over_less_specific_block_template() {74 public function test_more_specific_php_template_takes_precedence_over_less_specific_block_template() { 75 75 $page_id_template = 'page-1.php'; 76 76 $page_id_template_path = get_stylesheet_directory() . '/' . $page_id_template; … … 94 94 * 95 95 */ 96 function test_child_theme_php_template_takes_precedence_over_equally_specific_parent_theme_block_template() {96 public function test_child_theme_php_template_takes_precedence_over_equally_specific_parent_theme_block_template() { 97 97 switch_theme( 'block-theme-child' ); 98 98 … … 109 109 } 110 110 111 function test_child_theme_block_template_takes_precedence_over_equally_specific_parent_theme_php_template() {111 public function test_child_theme_block_template_takes_precedence_over_equally_specific_parent_theme_php_template() { 112 112 global $_wp_current_template_content; 113 113 -
trunk/tests/phpunit/tests/blocks/renderCommentTemplate.php
r53430 r54889 88 88 * @covers ::build_comment_query_vars_from_block 89 89 */ 90 function test_build_comment_query_vars_from_block_with_context() {90 public function test_build_comment_query_vars_from_block_with_context() { 91 91 $parsed_blocks = parse_blocks( 92 92 '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->' … … 119 119 * @covers ::build_comment_query_vars_from_block 120 120 */ 121 function test_build_comment_query_vars_from_block_with_context_no_pagination() {121 public function test_build_comment_query_vars_from_block_with_context_no_pagination() { 122 122 update_option( 'page_comments', false ); 123 123 $parsed_blocks = parse_blocks( … … 149 149 * @covers ::build_comment_query_vars_from_block 150 150 */ 151 function test_build_comment_query_vars_from_block_no_context() {151 public function test_build_comment_query_vars_from_block_no_context() { 152 152 $parsed_blocks = parse_blocks( 153 153 '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->' … … 179 179 * @covers ::build_comment_query_vars_from_block 180 180 */ 181 function test_build_comment_query_vars_from_block_pagination_with_no_comments() {181 public function test_build_comment_query_vars_from_block_pagination_with_no_comments() { 182 182 $comments_per_page = get_option( 'comments_per_page' ); 183 183 $default_comments_page = get_option( 'default_comments_page' ); … … 231 231 * @covers ::build_comment_query_vars_from_block 232 232 */ 233 function test_build_comment_query_vars_from_block_sets_cpage_var() {233 public function test_build_comment_query_vars_from_block_sets_cpage_var() { 234 234 235 235 // This could be any number, we set a fixed one instead of a random for better performance. … … 268 268 * @ticket 55567 269 269 */ 270 function test_rendering_comment_template() {270 public function test_rendering_comment_template() { 271 271 $parsed_blocks = parse_blocks( 272 272 '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->' … … 296 296 * @ticket 55567 297 297 */ 298 function test_rendering_comment_template_nested() {298 public function test_rendering_comment_template_nested() { 299 299 $first_level_ids = self::factory()->comment->create_post_comments( 300 300 self::$custom_post->ID, … … 397 397 * @ticket 55643 398 398 */ 399 function test_render_block_core_comment_content_converts_to_html() {399 public function test_render_block_core_comment_content_converts_to_html() { 400 400 $comment_id = self::$comment_ids[0]; 401 401 $new_content = "Paragraph One\n\nP2L1\nP2L2\n\nhttps://example.com/"; … … 431 431 * @covers ::build_comment_query_vars_from_block 432 432 */ 433 function test_build_comment_query_vars_from_block_with_comment_preview() {433 public function test_build_comment_query_vars_from_block_with_comment_preview() { 434 434 $parsed_blocks = parse_blocks( 435 435 '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->' … … 472 472 * @ticket 55643 473 473 */ 474 function test_rendering_comment_template_unmoderated_preview() {474 public function test_rendering_comment_template_unmoderated_preview() { 475 475 $parsed_blocks = parse_blocks( 476 476 '<!-- wp:comment-template --><!-- wp:comment-author-name /--><!-- wp:comment-content /--><!-- /wp:comment-template -->' -
trunk/tests/phpunit/tests/functions.php
r54861 r54889 2070 2070 * @covers ::wp_recursive_ksort 2071 2071 */ 2072 function test_wp_recursive_ksort() {2072 public function test_wp_recursive_ksort() { 2073 2073 // Create an array to test. 2074 2074 $theme_json = array( -
trunk/tests/phpunit/tests/kses.php
r54675 r54889 1648 1648 * @param string $expected The expected result from KSES. 1649 1649 */ 1650 function test_wp_kses_object_tag_allowed( $html, $expected ) {1650 public function test_wp_kses_object_tag_allowed( $html, $expected ) { 1651 1651 $this->assertSame( $expected, wp_kses_post( $html ) ); 1652 1652 } … … 1655 1655 * Data provider for test_wp_kses_object_tag_allowed(). 1656 1656 */ 1657 function data_wp_kses_object_tag_allowed() {1657 public function data_wp_kses_object_tag_allowed() { 1658 1658 return array( 1659 1659 'valid value for type' => array( … … 1758 1758 * @param string $expected The expected result from KSES. 1759 1759 */ 1760 function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) {1760 public function test_wp_kses_object_data_url_with_port_number_allowed( $html, $expected ) { 1761 1761 add_filter( 'upload_dir', array( $this, 'wp_kses_upload_dir_filter' ), 10, 2 ); 1762 1762 $this->assertSame( $expected, wp_kses_post( $html ) ); … … 1766 1766 * Data provider for test_wp_kses_object_data_url_with_port_number_allowed(). 1767 1767 */ 1768 function data_wp_kses_object_data_url_with_port_number_allowed() {1768 public function data_wp_kses_object_data_url_with_port_number_allowed() { 1769 1769 return array( 1770 1770 'url with port number' => array( … … 1805 1805 * @ticket 54261 1806 1806 */ 1807 function test_wp_kses_object_added_in_html_filter() {1807 public function test_wp_kses_object_added_in_html_filter() { 1808 1808 $html = <<<HTML 1809 1809 <object type="application/pdf" data="https://wordpress.org/foo.pdf" /> … … 1822 1822 } 1823 1823 1824 function filter_wp_kses_object_added_in_html_filter( $tags, $context ) {1824 public function filter_wp_kses_object_added_in_html_filter( $tags, $context ) { 1825 1825 if ( 'post' === $context ) { 1826 1826 $tags['object'] = array( … … 1849 1849 * @param array $allowed_html The allowed HTML to pass to KSES. 1850 1850 */ 1851 function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) {1851 public function test_wp_kses_allowed_values_list( $html, $expected, $allowed_html ) { 1852 1852 $this->assertSame( $expected, wp_kses( $html, $allowed_html ) ); 1853 1853 } … … 1856 1856 * Data provider for test_wp_kses_allowed_values_list(). 1857 1857 */ 1858 function data_wp_kses_allowed_values_list() {1858 public function data_wp_kses_allowed_values_list() { 1859 1859 $data = array( 1860 1860 'valid dir attribute value' => array( … … 1907 1907 * @param array $allowed_html The allowed HTML to pass to KSES. 1908 1908 */ 1909 function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) {1909 public function test_wp_kses_required_attribute( $html, $expected, $allowed_html ) { 1910 1910 $this->assertSame( $expected, wp_kses( $html, $allowed_html ) ); 1911 1911 } … … 1914 1914 * Data provider for test_wp_kses_required_attribute(). 1915 1915 */ 1916 function data_wp_kses_required_attribute() {1916 public function data_wp_kses_required_attribute() { 1917 1917 $data = array( 1918 1918 'valid dir attribute value' => array( -
trunk/tests/phpunit/tests/media.php
r54802 r54889 3478 3478 * @param string $context 3479 3479 */ 3480 function test_wp_get_loading_attr_default( $context ) {3480 public function test_wp_get_loading_attr_default( $context ) { 3481 3481 global $wp_query, $wp_the_query; 3482 3482 … … 3516 3516 } 3517 3517 3518 function data_wp_get_loading_attr_default() {3518 public function data_wp_get_loading_attr_default() { 3519 3519 return array( 3520 3520 array( 'the_content' ), … … 3526 3526 * @ticket 53675 3527 3527 */ 3528 function test_wp_omit_loading_attr_threshold_filter() {3528 public function test_wp_omit_loading_attr_threshold_filter() { 3529 3529 global $wp_query, $wp_the_query; 3530 3530 … … 3558 3558 * @ticket 53675 3559 3559 */ 3560 function test_wp_filter_content_tags_with_wp_get_loading_attr_default() {3560 public function test_wp_filter_content_tags_with_wp_get_loading_attr_default() { 3561 3561 global $wp_query, $wp_the_query; 3562 3562 -
trunk/tests/phpunit/tests/post/wpInsertPost.php
r54402 r54889 880 880 * @ticket 19954 881 881 */ 882 function test_updating_a_post_should_not_trash_categories() {882 public function test_updating_a_post_should_not_trash_categories() { 883 883 // Create a category and attach it to a new post. 884 884 $term_id = self::factory()->term->create( -
trunk/tests/phpunit/tests/query/fieldsClause.php
r54829 r54889 218 218 * @return string The filtered fields. 219 219 */ 220 function filter_posts_fields( $fields ) {220 public function filter_posts_fields( $fields ) { 221 221 return "$fields, 1 as test_post_fields"; 222 222 } … … 228 228 * @return array The filtered database clauses. 229 229 */ 230 function filter_posts_clauses( $clauses ) {230 public function filter_posts_clauses( $clauses ) { 231 231 $clauses['fields'] .= ', 2 as test_post_clauses'; 232 232 return $clauses; -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r54855 r54889 202 202 } 203 203 204 function test_get_settings_appearance_true_opts_in() {204 public function test_get_settings_appearance_true_opts_in() { 205 205 $theme_json = new WP_Theme_JSON( 206 206 array( … … 281 281 } 282 282 283 function test_get_settings_appearance_false_does_not_opt_in() {283 public function test_get_settings_appearance_false_does_not_opt_in() { 284 284 $theme_json = new WP_Theme_JSON( 285 285 array( … … 2736 2736 * @ticket 55505 2737 2737 */ 2738 function test_export_data() {2738 public function test_export_data() { 2739 2739 $theme = new WP_Theme_JSON( 2740 2740 array( … … 2814 2814 * @ticket 55505 2815 2815 */ 2816 function test_export_data_deals_with_empty_user_data() {2816 public function test_export_data_deals_with_empty_user_data() { 2817 2817 $theme = new WP_Theme_JSON( 2818 2818 array( … … 2864 2864 * @ticket 55505 2865 2865 */ 2866 function test_export_data_deals_with_empty_theme_data() {2866 public function test_export_data_deals_with_empty_theme_data() { 2867 2867 $user = new WP_Theme_JSON( 2868 2868 array( … … 2915 2915 * @ticket 55505 2916 2916 */ 2917 function test_export_data_deals_with_empty_data() {2917 public function test_export_data_deals_with_empty_data() { 2918 2918 $theme_v2 = new WP_Theme_JSON( 2919 2919 array( … … 2940 2940 * @ticket 55505 2941 2941 */ 2942 function test_export_data_sets_appearance_tools() {2942 public function test_export_data_sets_appearance_tools() { 2943 2943 $theme = new WP_Theme_JSON( 2944 2944 array( … … 2974 2974 * @ticket 56611 2975 2975 */ 2976 function test_export_data_sets_use_root_padding_aware_alignments() {2976 public function test_export_data_sets_use_root_padding_aware_alignments() { 2977 2977 $theme = new WP_Theme_JSON( 2978 2978 array( … … 3507 3507 * @ticket 56467 3508 3508 */ 3509 function test_get_styles_for_block_with_padding_aware_alignments() {3509 public function test_get_styles_for_block_with_padding_aware_alignments() { 3510 3510 $theme_json = new WP_Theme_JSON( 3511 3511 array( … … 3541 3541 * @ticket 56467 3542 3542 */ 3543 function test_get_styles_for_block_without_padding_aware_alignments() {3543 public function test_get_styles_for_block_without_padding_aware_alignments() { 3544 3544 $theme_json = new WP_Theme_JSON( 3545 3545 array( … … 3572 3572 * @ticket 56467 3573 3573 */ 3574 function test_get_styles_for_block_with_content_width() {3574 public function test_get_styles_for_block_with_content_width() { 3575 3575 $theme_json = new WP_Theme_JSON( 3576 3576 array( … … 3599 3599 * @ticket 56611 3600 3600 */ 3601 function test_get_styles_with_appearance_tools() {3601 public function test_get_styles_with_appearance_tools() { 3602 3602 $theme_json = new WP_Theme_JSON( 3603 3603 array( … … 3629 3629 * @param array $expected_output Expected output from data provider. 3630 3630 */ 3631 function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) {3631 public function test_should_set_spacing_sizes( $spacing_scale, $expected_output ) { 3632 3632 $theme_json = new WP_Theme_JSON( 3633 3633 array( … … 3652 3652 * @return array 3653 3653 */ 3654 function data_generate_spacing_scale_fixtures() {3654 public function data_generate_spacing_scale_fixtures() { 3655 3655 return array( 3656 3656 'only one value when single step in spacing scale' => array( … … 3946 3946 * @return array 3947 3947 */ 3948 function data_set_spacing_sizes_when_invalid() {3948 public function data_set_spacing_sizes_when_invalid() { 3949 3949 return array( 3950 3950 'missing operator value' => array( … … 4034 4034 * @return array 4035 4035 */ 4036 function data_update_separator_declarations() {4036 public function data_update_separator_declarations() { 4037 4037 return array( 4038 4038 // If only background is defined, test that includes border-color to the style so it is applied on the front end. -
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r54799 r54889 451 451 * @ticket 54336 452 452 */ 453 function test_add_theme_supports_are_loaded_for_themes_without_theme_json() {453 public function test_add_theme_supports_are_loaded_for_themes_without_theme_json() { 454 454 switch_theme( 'default' ); 455 455 $color_palette = array( … … 499 499 * @ticket 56611 500 500 */ 501 function test_merges_child_theme_json_into_parent_theme_json() {501 public function test_merges_child_theme_json_into_parent_theme_json() { 502 502 switch_theme( 'block-theme-child' ); 503 503 … … 620 620 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 621 621 */ 622 function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries() {622 public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries() { 623 623 // Switch to a theme that does have support. 624 624 switch_theme( 'block-theme' ); … … 660 660 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 661 661 */ 662 function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries_for_logged_out_users() {662 public function test_get_user_data_from_wp_global_styles_does_not_use_uncached_queries_for_logged_out_users() { 663 663 // Switch to a theme that does have support. 664 664 switch_theme( 'block-theme' ); … … 681 681 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 682 682 */ 683 function test_get_user_data_from_wp_global_styles_does_not_run_for_theme_without_support() {683 public function test_get_user_data_from_wp_global_styles_does_not_run_for_theme_without_support() { 684 684 // The 'default' theme does not support theme.json. 685 685 switch_theme( 'default' ); … … 703 703 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 704 704 */ 705 function test_get_user_data_from_wp_global_styles_does_exist() {705 public function test_get_user_data_from_wp_global_styles_does_exist() { 706 706 // Switch to a theme that does have support. 707 707 switch_theme( 'block-theme' ); … … 720 720 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 721 721 */ 722 function test_get_user_data_from_wp_global_styles_create_post() {722 public function test_get_user_data_from_wp_global_styles_create_post() { 723 723 // Switch to a theme that does have support. 724 724 switch_theme( 'block-theme' ); … … 739 739 * @covers WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles 740 740 */ 741 function test_get_user_data_from_wp_global_styles_filter_state() {741 public function test_get_user_data_from_wp_global_styles_filter_state() { 742 742 // Switch to a theme that does have support. 743 743 switch_theme( 'block-theme' ); … … 755 755 * @covers WP_Theme_JSON_Resolver::get_theme_data 756 756 */ 757 function test_get_theme_data_theme_supports_overrides_theme_json() {757 public function test_get_theme_data_theme_supports_overrides_theme_json() { 758 758 // Test that get_theme_data() returns a WP_Theme_JSON object. 759 759 $theme_json_resolver = new WP_Theme_JSON_Resolver(); … … 778 778 * @covers WP_Theme_JSON_Resolver::get_theme_data 779 779 */ 780 function test_get_theme_data_does_not_parse_theme_json_if_not_present() {780 public function test_get_theme_data_does_not_parse_theme_json_if_not_present() { 781 781 // The 'default' theme does not support theme.json. 782 782 switch_theme( 'default' ); -
trunk/tests/phpunit/tests/theme/wpThemeJsonSchema.php
r52049 r54889 20 20 * @ticket 54336 21 21 */ 22 function test_migrate_v1_to_v2() {22 public function test_migrate_v1_to_v2() { 23 23 $theme_json_v1 = array( 24 24 'version' => 1, -
trunk/tests/phpunit/tests/user/query.php
r54402 r54889 2012 2012 * @return array 2013 2013 */ 2014 function data_returning_field_subset_as_string() {2014 public function data_returning_field_subset_as_string() { 2015 2015 $data = array( 2016 2016 'id' => array( … … 2094 2094 * @return array 2095 2095 */ 2096 function data_returning_field_subset_as_array() {2096 public function data_returning_field_subset_as_array() { 2097 2097 $data = array( 2098 2098 'id' => array( -
trunk/tests/phpunit/tests/widgets.php
r54872 r54889 594 594 * @ticket 52728 595 595 */ 596 function test_widget_display_callback_handles_arrayobject() {596 public function test_widget_display_callback_handles_arrayobject() { 597 597 $widget = new WP_Widget_Text(); 598 598
Note: See TracChangeset
for help on using the changeset viewer.