Make WordPress Core

Changeset 50339


Ignore:
Timestamp:
02/13/2021 01:47:12 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Tests: Add missing @covers tags for files in phpunit/tests/general/.

Props patopaiar, jrf.
See #39265.

Location:
trunk/tests/phpunit/tests/general
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/paginateLinks.php

    r50292 r50339  
    11<?php
    22
     3/**
     4 * @group general
     5 * @group template
     6 * @covers ::paginate_links
     7 */
    38class Tests_General_PaginateLinks extends WP_UnitTestCase {
    49
  • trunk/tests/phpunit/tests/general/template.php

    r49992 r50339  
    33 * A set of unit tests for functions in wp-includes/general-template.php
    44 *
     5 * @group general
    56 * @group template
    67 * @group site_icon
     
    3435        /**
    3536         * @group site_icon
     37         * @covers ::get_site_icon_url
    3638         */
    3739        function test_get_site_icon_url() {
     
    4749        /**
    4850         * @group site_icon
     51         * @covers ::site_icon_url
    4952         */
    5053        function test_site_icon_url() {
     
    5962        /**
    6063         * @group site_icon
     64         * @covers ::has_site_icon
    6165         */
    6266        function test_has_site_icon() {
     
    7478         * @group multisite
    7579         * @group ms-required
     80         * @covers ::has_site_icon
    7681         */
    7782        function test_has_site_icon_returns_true_when_called_for_other_site_with_site_icon_set() {
     
    8893         * @group multisite
    8994         * @group ms-required
     95         * @covers ::has_site_icon
    9096         */
    9197        function test_has_site_icon_returns_false_when_called_for_other_site_without_site_icon_set() {
     
    97103        /**
    98104         * @group site_icon
     105         * @covers ::wp_site_icon
    99106         */
    100107        function test_wp_site_icon() {
     
    118125        /**
    119126         * @group site_icon
     127         * @covers ::wp_site_icon
    120128         */
    121129        function test_wp_site_icon_with_filter() {
     
    141149
    142150        /**
    143          * @group site_icon
    144151         * @ticket 38377
     152         * @group site_icon
     153         * @covers ::wp_site_icon
    145154         */
    146155        function test_customize_preview_wp_site_icon_empty() {
     
    158167
    159168        /**
    160          * @group site_icon
    161169         * @ticket 38377
     170         * @group site_icon
     171         * @covers ::wp_site_icon
    162172         */
    163173        function test_customize_preview_wp_site_icon_dirty() {
     
    242252        /**
    243253         * @group custom_logo
     254         * @covers ::has_custom_logo
    244255         *
    245256         * @since 4.5.0
     
    259270         * @group multisite
    260271         * @group ms-required
     272         * @covers ::has_custom_logo
    261273         */
    262274        function test_has_custom_logo_returns_true_when_called_for_other_site_with_custom_logo_set() {
     
    273285         * @group multisite
    274286         * @group ms-required
     287         * @covers ::has_custom_logo
    275288         */
    276289        function test_has_custom_logo_returns_false_when_called_for_other_site_without_custom_logo_set() {
     
    282295        /**
    283296         * @group custom_logo
     297         * @covers ::get_custom_logo
    284298         *
    285299         * @since 4.5.0
     
    301315         * @group multisite
    302316         * @group ms-required
     317         * @covers ::get_custom_logo
    303318         */
    304319        function test_get_custom_logo_returns_logo_when_called_for_other_site_with_custom_logo_set() {
     
    329344        /**
    330345         * @group custom_logo
     346         * @covers ::the_custom_logo
    331347         *
    332348         * @since 4.5.0
     
    356372
    357373        /**
     374         * @ticket 38768
    358375         * @group custom_logo
    359          * @ticket 38768
     376         * @covers ::the_custom_logo
    360377         */
    361378        function test_the_custom_logo_with_alt() {
     
    421438         * @ticket 38253
    422439         * @group ms-required
     440         * @covers ::get_site_icon_url
    423441         */
    424442        function test_get_site_icon_url_preserves_switched_state() {
     
    440458         * @ticket 38253
    441459         * @group ms-required
     460         * @covers ::has_custom_logo
    442461         */
    443462        function test_has_custom_logo_preserves_switched_state() {
     
    459478         * @ticket 38253
    460479         * @group ms-required
     480         * @covers ::get_custom_logo
    461481         */
    462482        function test_get_custom_logo_preserves_switched_state() {
     
    477497        /**
    478498         * @ticket 40969
     499         *
     500         * @covers ::get_header
    479501         */
    480502        function test_get_header_returns_nothing_on_success() {
     
    488510        /**
    489511         * @ticket 40969
     512         *
     513         * @covers ::get_footer
    490514         */
    491515        function test_get_footer_returns_nothing_on_success() {
     
    499523        /**
    500524         * @ticket 40969
     525         *
     526         * @covers ::get_sidebar
    501527         */
    502528        function test_get_sidebar_returns_nothing_on_success() {
     
    510536        /**
    511537         * @ticket 40969
     538         *
     539         * @covers ::get_template_part
    512540         */
    513541        function test_get_template_part_returns_nothing_on_success() {
     
    521549        /**
    522550         * @ticket 40969
     551         *
     552         * @covers ::get_template_part
    523553         */
    524554        function test_get_template_part_returns_false_on_failure() {
     
    528558        /**
    529559         * @ticket 21676
     560         *
     561         * @covers ::get_template_part
    530562         */
    531563        function test_get_template_part_passes_arguments_to_template() {
     
    538570         * @ticket 9862
    539571         * @dataProvider data_selected_and_checked_with_equal_values
     572         *
     573         * @covers ::selected
     574         * @covers ::checked
    540575         */
    541576        function test_selected_and_checked_with_equal_values( $selected, $current ) {
     
    562597         * @ticket 9862
    563598         * @dataProvider data_selected_and_checked_with_non_equal_values
     599         *
     600         * @covers ::selected
     601         * @covers ::checked
    564602         */
    565603        function test_selected_and_checked_with_non_equal_values( $selected, $current ) {
     
    578616        /**
    579617         * @ticket 44183
     618         *
     619         * @covers ::get_the_archive_title
    580620         */
    581621        function test_get_the_archive_title_is_correct_for_author_queries() {
  • trunk/tests/phpunit/tests/general/wpError.php

    r50292 r50339  
    66 * @group errors
    77 *
     8 * @covers WP_Error
    89 * @coversDefaultClass WP_Error
    910 */
     
    2627        }
    2728
     29        /**
     30         * @covers ::__construct
     31         */
    2832        public function test_WP_Error_should_be_of_type_WP_Error() {
    2933                $this->assertWPError( $this->wp_error );
    3034        }
    3135
     36        /**
     37         * @covers ::__construct
     38         */
    3239        public function test_WP_Error_with_default_empty_parameters_should_add_no_errors() {
    3340                $this->assertEmpty( $this->wp_error->errors );
    3441        }
    3542
     43        /**
     44         * @covers ::__construct
     45         * @covers ::get_error_code
     46         */
    3647        public function test_WP_Error_with_empty_code_should_add_no_code() {
    3748                $this->assertSame( '', $this->wp_error->get_error_code() );
    3849        }
    3950
     51        /**
     52         * @covers ::__construct
     53         * @covers ::get_error_message
     54         */
    4055        public function test_WP_Error_with_empty_code_should_add_no_message() {
    4156                $this->assertSame( '', $this->wp_error->get_error_message() );
    4257        }
    4358
     59        /**
     60         * @covers ::__construct
     61         */
    4462        public function test_WP_Error_with_empty_code_should_add_no_error_data() {
    4563                $this->assertEmpty( $this->wp_error->error_data );
    4664        }
    4765
     66        /**
     67         * @covers ::__construct
     68         * @covers ::get_error_code
     69         */
    4870        public function test_WP_Error_with_code_and_empty_message_should_add_error_with_that_code() {
    4971                $wp_error = new WP_Error( 'code' );
     
    5274        }
    5375
     76        /**
     77         * @covers ::__construct
     78         * @covers ::get_error_message
     79         */
    5480        public function test_WP_Error_with_code_and_empty_message_should_add_error_with_that_code_and_empty_message() {
    5581                $wp_error = new WP_Error( 'code' );
     
    5884        }
    5985
     86        /**
     87         * @covers ::__construct
     88         * @covers ::get_error_data
     89         */
    6090        public function test_WP_Error_with_code_and_empty_message_and_empty_data_should_add_error_but_not_associated_data() {
    6191                $wp_error = new WP_Error( 'code' );
     
    6494        }
    6595
     96        /**
     97         * @covers ::__construct
     98         * @covers ::get_error_data
     99         */
    66100        public function test_WP_Error_with_code_and_empty_message_and_non_empty_data_should_add_error_with_empty_message_and_that_stored_data() {
    67101                $wp_error = new WP_Error( 'code', '', 'data' );
     
    70104        }
    71105
     106        /**
     107         * @covers ::__construct
     108         * @covers ::get_error_code
     109         */
    72110        public function test_WP_Error_with_code_and_message_should_add_error_with_that_code() {
    73111                $wp_error = new WP_Error( 'code', 'message' );
     
    76114        }
    77115
     116        /**
     117         * @covers ::__construct
     118         * @covers ::get_error_message
     119         */
    78120        public function test_WP_Error_with_code_and_message_should_add_error_with_that_message() {
    79121                $wp_error = new WP_Error( 'code', 'message' );
     
    82124        }
    83125
     126        /**
     127         * @covers ::__construct
     128         * @covers ::get_error_code
     129         */
    84130        public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_code() {
    85131                $wp_error = new WP_Error( 'code', 'message', 'data' );
     
    88134        }
    89135
     136        /**
     137         * @covers ::__construct
     138         * @covers ::get_error_message
     139         */
    90140        public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_message() {
    91141                $wp_error = new WP_Error( 'code', 'message', 'data' );
     
    94144        }
    95145
     146        /**
     147         * @covers ::__construct
     148         * @covers ::get_error_data
     149         */
    96150        public function test_WP_Error_with_code_and_message_and_data_should_add_error_with_that_data() {
    97151                $wp_error = new WP_Error( 'code', 'message', 'data' );
     
    101155
    102156        /**
     157         * @covers ::__construct
    103158         * @covers ::get_error_codes
    104159         */
     
    108163
    109164        /**
     165         * @covers ::add
    110166         * @covers ::get_error_codes
    111167         */
     
    117173
    118174        /**
     175         * @covers ::add
    119176         * @covers ::get_error_codes
    120177         */
     
    129186
    130187        /**
     188         * @covers ::__construct
    131189         * @covers ::get_error_code
    132190         */
     
    136194
    137195        /**
     196         * @covers ::add
    138197         * @covers ::get_error_code
    139198         */
     
    145204
    146205        /**
     206         * @covers ::add
    147207         * @covers ::get_error_code
    148208         */
     
    155215
    156216        /**
     217         * @covers ::__construct
    157218         * @covers ::get_error_messages
    158219         */
     
    162223
    163224        /**
     225         * @covers ::add
    164226         * @covers ::get_error_messages
    165227         */
     
    171233
    172234        /**
     235         * @covers ::add
    173236         * @covers ::get_error_messages
    174237         */
     
    181244
    182245        /**
     246         * @covers ::__construct
    183247         * @covers ::get_error_messages
    184248         */
     
    188252
    189253        /**
     254         * @covers ::add
    190255         * @covers ::get_error_messages
    191256         */
     
    197262
    198263        /**
     264         * @covers ::add
    199265         * @covers ::get_error_messages
    200266         */
     
    207273
    208274        /**
     275         * @covers ::__construct
    209276         * @covers ::get_error_message
    210277         */
     
    214281
    215282        /**
     283         * @covers ::add
    216284         * @covers ::get_error_message
    217285         */
     
    223291
    224292        /**
     293         * @covers ::add
    225294         * @covers ::get_error_message
    226295         */
     
    233302
    234303        /**
     304         * @covers ::add
    235305         * @covers ::get_error_message
    236306         */
     
    244314
    245315        /**
     316         * @covers ::__construct
    246317         * @covers ::get_error_message
    247318         */
     
    251322
    252323        /**
     324         * @covers ::add
    253325         * @covers ::get_error_message
    254326         */
     
    260332
    261333        /**
     334         * @covers ::add
    262335         * @covers ::get_error_message
    263336         */
     
    270343
    271344        /**
     345         * @covers ::__construct
    272346         * @covers ::get_error_data
    273347         */
     
    277351
    278352        /**
     353         * @covers ::add
    279354         * @covers ::get_error_data
    280355         */
     
    286361
    287362        /**
     363         * @covers ::add
    288364         * @covers ::get_error_data
    289365         */
     
    296372
    297373        /**
     374         * @covers ::add
    298375         * @covers ::get_error_data
    299376         */
     
    306383
    307384        /**
     385         * @covers ::add
    308386         * @covers ::get_error_data
    309387         */
     
    317395
    318396        /**
     397         * @covers ::add
    319398         * @covers ::get_error_data
    320399         */
     
    328407
    329408        /**
     409         * @covers ::__construct
    330410         * @covers ::get_error_data
    331411         */
     
    335415
    336416        /**
     417         * @covers ::add
    337418         * @covers ::get_error_data
    338419         */
     
    344425
    345426        /**
     427         * @covers ::add
    346428         * @covers ::get_error_data
    347429         */
     
    354436
    355437        /**
     438         * @covers ::add
    356439         * @covers ::get_error_data
    357440         */
     
    366449
    367450        /**
     451         * @covers ::add
    368452         * @covers ::get_error_data
    369453         */
     
    377461
    378462        /**
     463         * @covers ::__construct
    379464         * @covers ::get_all_error_data
    380465         */
     
    384469
    385470        /**
     471         * @covers ::add
    386472         * @covers ::get_all_error_data
    387473         */
     
    393479
    394480        /**
     481         * @covers ::add
    395482         * @covers ::get_all_error_data
    396483         */
     
    405492
    406493        /**
     494         * @covers ::add
    407495         * @covers ::get_all_error_data
    408496         */
     
    416504
    417505        /**
     506         * @covers ::add
    418507         * @covers ::get_all_error_data
    419508         */
     
    429518
    430519        /**
     520         * @covers ::__construct
    431521         * @covers ::has_errors
    432522         */
     
    436526
    437527        /**
     528         * @covers ::add
    438529         * @covers ::has_errors
    439530         */
     
    481572        /**
    482573         * @covers ::add
     574         * @covers ::get_error_code
    483575         */
    484576        public function test_add_with_code_empty_message_empty_data_should_add_error_with_code() {
     
    490582        /**
    491583         * @covers ::add
     584         * @covers ::get_error_message
    492585         */
    493586        public function test_add_with_code_empty_message_empty_data_should_add_error_with_empty_message() {
     
    499592        /**
    500593         * @covers ::add
     594         * @covers ::get_error_data
    501595         */
    502596        public function test_add_with_code_empty_message_empty_data_should_not_add_error_data() {
     
    508602        /**
    509603         * @covers ::add
     604         * @covers ::get_error_message
    510605         */
    511606        public function test_add_with_code_and_message_and_empty_data_should_should_add_error_with_that_message() {
     
    517612        /**
    518613         * @covers ::add
     614         * @covers ::get_error_data
    519615         */
    520616        public function test_add_with_code_and_message_and_empty_data_should_not_alter_stored_data() {
     
    526622        /**
    527623         * @covers ::add
     624         * @covers ::get_error_code
    528625         */
    529626        public function test_add_with_code_and_empty_message_and_data_should_add_error_with_that_code() {
     
    535632        /**
    536633         * @covers ::add
     634         * @covers ::get_error_data
    537635         */
    538636        public function test_add_with_code_and_empty_message_and_data_should_store_that_data() {
     
    544642        /**
    545643         * @covers ::add
     644         * @covers ::get_error_code
    546645         */
    547646        public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_code() {
     
    553652        /**
    554653         * @covers ::add
     654         * @covers ::get_error_message
    555655         */
    556656        public function test_add_with_code_and_message_and_data_should_add_an_error_with_that_message() {
     
    562662        /**
    563663         * @covers ::add
     664         * @covers ::get_error_data
    564665         */
    565666        public function test_add_with_code_and_message_and_data_should_store_that_data() {
     
    571672        /**
    572673         * @covers ::add
     674         * @covers ::get_error_messages
    573675         */
    574676        public function test_add_multiple_times_with_the_same_code_should_add_additional_messages_for_that_code() {
     
    583685        /**
    584686         * @covers ::add
     687         * @covers ::get_error_data
    585688         */
    586689        public function test_add_multiple_times_with_the_same_code_and_different_data_should_store_only_the_last_added_data() {
     
    611714        /**
    612715         * @covers ::add_data
     716         * @covers ::get_error_data
    613717         */
    614718        public function test_add_data_with_data_empty_code_and_one_error_should_store_the_data_under_that_code() {
     
    621725        /**
    622726         * @covers ::add_data
     727         * @covers ::get_error_data
    623728         */
    624729        public function test_add_data_with_data_empty_code_and_multiple_errors_with_different_codes_should_store_it_under_the_first_code() {
     
    633738        /**
    634739         * @covers ::add_data
     740         * @covers ::get_error_data
    635741         */
    636742        public function test_add_data_with_data_empty_code_and_multiple_errors_with_same_code_should_store_it_under_the_first_code() {
     
    686792        /**
    687793         * @covers ::add_data
     794         * @covers ::get_error_data
    688795         */
    689796        public function test_add_data_with_data_and_code_should_add_data() {
     
    762869        /**
    763870         * @covers ::remove
     871         * @covers ::get_error_data
     872         * @covers ::get_all_error_data
    764873         */
    765874        public function test_remove_should_remove_the_error_data_associated_with_the_given_code() {
     
    775884
    776885        /**
    777          * @covers ::merge_from()
     886         * @covers ::merge_from
     887         * @covers ::get_error_messages
     888         * @covers ::get_error_data
     889         * @covers ::get_all_error_data
     890         * @covers ::get_error_message
    778891         */
    779892        public function test_merge_from_should_copy_other_error_into_instance() {
     
    791904
    792905        /**
    793          * @covers ::merge_from()
     906         * @covers ::merge_from
     907         * @covers ::has_errors
    794908         */
    795909        public function test_merge_from_with_no_errors_should_not_add_to_instance() {
     
    802916
    803917        /**
    804          * @covers ::export_to()
     918         * @covers ::export_to
     919         * @covers ::get_error_messages
     920         * @covers ::get_error_data
     921         * @covers ::get_all_error_data
     922         * @covers ::get_error_message
    805923         */
    806924        public function test_export_to_should_copy_instance_into_other_error() {
     
    820938
    821939        /**
    822          * @covers ::export_to()
     940         * @covers ::export_to
     941         * @covers ::has_errors
    823942         */
    824943        public function test_export_to_with_no_errors_should_not_add_to_other_error() {
  • trunk/tests/phpunit/tests/general/wpGetArchives.php

    r50292 r50339  
    33/**
    44 * @group general
     5 * @group template
     6 * @covers ::wp_get_archives
    57 */
    68class Tests_General_wpGetArchives extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/general/wpGetDocumentTitle.php

    r50292 r50339  
    44 * A set of unit tests for functions in wp-includes/general-template.php
    55 *
     6 * @group general
    67 * @group template
    78 * @group document-title
     9 * @covers ::wp_get_document_title
     10 * @covers ::_wp_render_title_tag
    811 */
    912class Tests_General_wpGetDocumentTitle extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/general/wpResourceHints.php

    r50337 r50339  
    22
    33/**
     4 * @group general
    45 * @group template
    56 * @ticket 34292
     7 * @covers ::wp_resource_hints
    68 */
    79class Tests_General_wpResourceHints extends WP_UnitTestCase {
Note: See TracChangeset for help on using the changeset viewer.