Make WordPress Core


Ignore:
Timestamp:
08/08/2022 11:12:30 PM (3 years ago)
Author:
azaozz
Message:

Build/Test Tools: Add @covers tags to the comments tests.

Props pbearne, jrf, hellofromTonya, patopaiar, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r52010 r53863  
    3131    }
    3232
     33    /**
     34     * @covers ::wp_update_comment
     35     */
    3336    public function test_wp_update_comment() {
    3437        $post  = self::factory()->post->create_and_get(
     
    7982    /**
    8083     * @ticket 30627
     84     *
     85     * @covers ::wp_update_comment
    8186     */
    8287    public function test_wp_update_comment_updates_comment_type() {
     
    96101    /**
    97102     * @ticket 36784
     103     *
     104     * @covers ::wp_update_comment
    98105     */
    99106    public function test_wp_update_comment_updates_comment_meta() {
     
    115122    /**
    116123     * @ticket 30307
     124     *
     125     * @covers ::wp_update_comment
    117126     */
    118127    public function test_wp_update_comment_updates_user_id() {
     
    132141    /**
    133142     * @ticket 34954
     143     *
     144     * @covers ::wp_update_comment
    134145     */
    135146    public function test_wp_update_comment_with_no_post_id() {
     
    153164    /**
    154165     * @ticket 39732
     166     *
     167     * @covers ::wp_update_comment
    155168     */
    156169    public function test_wp_update_comment_returns_false_for_invalid_comment_or_post_id() {
     
    176189    /**
    177190     * @ticket 39732
     191     *
     192     * @covers ::wp_update_comment
    178193     */
    179194    public function test_wp_update_comment_is_wp_error() {
     
    202217    }
    203218
     219    /**
     220     * @covers ::get_approved_comments
     221     */
    204222    public function test_get_approved_comments() {
    205223        $ca1 = self::factory()->comment->create(
     
    258276    /**
    259277     * @ticket 30412
     278     *
     279     * @covers ::get_approved_comments
    260280     */
    261281    public function test_get_approved_comments_with_post_id_0_should_return_empty_array() {
     
    274294    /**
    275295     * @ticket 14279
     296     *
     297     * @covers ::wp_new_comment
    276298     */
    277299    public function test_wp_new_comment_respects_dates() {
     
    297319    /**
    298320     * @ticket 14601
     321     *
     322     * @covers ::wp_new_comment
    299323     */
    300324    public function test_wp_new_comment_respects_author_ip() {
     
    318342    /**
    319343     * @ticket 14601
     344     *
     345     * @covers ::wp_new_comment
    320346     */
    321347    public function test_wp_new_comment_respects_author_ip_empty_string() {
     
    339365    /**
    340366     * @ticket 14601
     367     *
     368     * @covers ::wp_new_comment
    341369     */
    342370    public function test_wp_new_comment_respects_comment_agent() {
     
    361389    /**
    362390     * @ticket 14601
     391     *
     392     * @covers ::wp_new_comment
    363393     */
    364394    public function test_wp_new_comment_should_trim_provided_comment_agent_to_254_chars() {
     
    383413    /**
    384414     * @ticket 14601
     415     *
     416     * @covers ::wp_new_comment
    385417     */
    386418    public function test_wp_new_comment_respects_comment_agent_empty_string() {
     
    403435    }
    404436
    405 
     437    /**
     438     * @covers ::wp_new_comment
     439     */
    406440    public function test_comment_field_lengths() {
    407441        $data = array(
     
    425459    /**
    426460     * @ticket 32566
     461     *
     462     * @covers ::wp_notify_moderator
    427463     */
    428464    public function test_wp_notify_moderator_should_not_throw_notice_when_post_author_is_0() {
     
    442478    }
    443479
     480    /**
     481     * @covers ::wp_new_comment_notify_postauthor
     482     */
    444483    public function test_wp_new_comment_notify_postauthor_should_send_email_when_comment_is_approved() {
    445484        $c = self::factory()->comment->create(
     
    453492    }
    454493
     494    /**
     495     * @covers ::wp_new_comment_notify_postauthor
     496     */
    455497    public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_is_unapproved() {
    456498        $c = self::factory()->comment->create(
     
    467509    /**
    468510     * @ticket 33587
     511     *
     512     * @covers ::wp_new_comment_notify_postauthor
    469513     */
    470514    public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_marked_as_spam() {
     
    482526    /**
    483527     * @ticket 35006
     528     *
     529     * @covers ::wp_new_comment_notify_postauthor
    484530     */
    485531    public function test_wp_new_comment_notify_postauthor_should_not_send_email_when_comment_has_been_trashed() {
     
    497543    /**
    498544     * @ticket 43805
     545     *
     546     * @covers ::wp_new_comment_notify_postauthor
    499547     */
    500548    public function test_wp_new_comment_notify_postauthor_content_should_include_link_to_parent() {
     
    521569    /**
    522570     * @ticket 43805
     571     *
     572     * @covers ::wp_new_comment_notify_moderator
    523573     */
    524574    public function test_wp_new_comment_notify_moderator_content_should_include_link_to_parent() {
     
    557607    /**
    558608     * @ticket 12431
     609     *
     610     * @covers ::get_comment_meta
    559611     */
    560612    public function test_wp_new_comment_with_meta() {
     
    574626    /**
    575627     * @ticket 8071
     628     *
     629     * @covers WP_Comment::get_children
    576630     */
    577631    public function test_wp_comment_get_children_should_fill_children() {
     
    634688    /**
    635689     * @ticket 27571
     690     *
     691     * @covers ::get_comment
    636692     */
    637693    public function test_post_properties_should_be_lazyloaded() {
     
    685741    /**
    686742     * @ticket 761
     743     *
     744     * @covers ::wp_new_comment
    687745     */
    688746    public function test_wp_notify_moderator_filter_moderation_notify_option_true_filter_false() {
     
    706764    /**
    707765     * @ticket 761
     766     *
     767     * @covers ::wp_new_comment
    708768     */
    709769    public function test_wp_notify_moderator_filter_moderation_notify_option_false_filter_true() {
     
    727787    /**
    728788     * @ticket 761
     789     *
     790     * @covers ::wp_new_comment
    729791     */
    730792    public function test_wp_notify_post_author_filter_comments_notify_option_true_filter_false() {
     
    749811    /**
    750812     * @ticket 761
     813     *
     814     * @covers ::wp_new_comment
    751815     */
    752816    public function test_wp_notify_post_author_filter_comments_notify_option_false_filter_true() {
     
    853917    }
    854918
     919    /**
     920     * @covers ::_close_comments_for_old_post
     921     */
    855922    public function test_close_comments_for_old_post() {
    856923        update_option( 'close_comments_for_old_posts', true );
     
    868935    }
    869936
     937    /**
     938     * @covers ::_close_comments_for_old_post
     939     */
    870940    public function test_close_comments_for_old_post_undated_draft() {
    871941        $draft_id             = self::factory()->post->create(
     
    882952    /**
    883953     * @ticket 35276
     954     *
     955     * @covers ::wp_update_comment
    884956     */
    885957    public function test_wp_update_comment_author_id_and_agent() {
     
    918990    }
    919991
     992    /**
     993     * @covers ::wp_get_comment_fields_max_lengths
     994     */
    920995    public function test_wp_get_comment_fields_max_lengths() {
    921996        $expected = array(
     
    9381013     * @group privacy
    9391014     * @ticket 43442
     1015     *
     1016     * @covers ::wp_comments_personal_data_eraser
    9401017     */
    9411018    public function test_wp_comments_personal_data_eraser() {
     
    9951072     * @group privacy
    9961073     * @ticket 43442
     1074     *
     1075     * @covers ::wp_comments_personal_data_eraser
    9971076     */
    9981077    public function test_wp_comments_personal_data_eraser_empty_first_page_output() {
     
    10141093     * @group privacy
    10151094     * @ticket 43442
     1095     *
     1096     * @covers ::wp_comments_personal_data_eraser
    10161097     */
    10171098    public function test_wp_comments_personal_data_eraser_non_empty_first_page_output() {
     
    10461127     * @group privacy
    10471128     * @ticket 43442
     1129     *
     1130     * @covers ::wp_comments_personal_data_eraser
    10481131     */
    10491132    public function test_wp_comments_personal_data_eraser_empty_second_page_output() {
     
    10781161     * @group privacy
    10791162     * @ticket 43442
     1163     *
     1164     * @covers ::wp_comments_personal_data_eraser
    10801165     */
    10811166    public function test_wp_anonymize_comment_filter_to_prevent_comment_anonymization() {
     
    11151200     * @group privacy
    11161201     * @ticket 43442
     1202     *
     1203     * @covers ::wp_comments_personal_data_eraser
    11171204     */
    11181205    public function test_wp_anonymize_comment_filter_to_prevent_comment_anonymization_with_custom_message() {
     
    11801267    }
    11811268
     1269    /**
     1270     * @covers ::wp_trash_comment
     1271     */
    11821272    public function test_trash_should_invalidate_comment_cache() {
    11831273        global $wpdb;
     
    11941284    }
    11951285
     1286    /**
     1287     * @covers ::wp_untrash_comment
     1288     */
    11961289    public function test_untrash_should_invalidate_comment_cache() {
    11971290        global $wpdb;
     
    12101303    }
    12111304
     1305    /**
     1306     * @covers ::wp_spam_comment
     1307     */
    12121308    public function test_spam_should_invalidate_comment_cache() {
    12131309        global $wpdb;
     
    12241320    }
    12251321
     1322    /**
     1323     * @covers ::wp_unspam_comment
     1324     */
    12261325    public function test_unspam_should_invalidate_comment_cache() {
    12271326        global $wpdb;
     
    12451344     * @group privacy
    12461345     * @ticket 43440
     1346     *
     1347     * @covers ::wp_comments_personal_data_exporter
    12471348     */
    12481349    public function test_wp_comments_personal_data_exporter() {
     
    12911392     * @group privacy
    12921393     * @ticket 43440
     1394     *
     1395     * @covers ::wp_comments_personal_data_exporter
    12931396     */
    12941397    public function test_wp_comments_personal_data_exporter_no_comments_found() {
     
    13091412     * @group privacy
    13101413     * @ticket 43440
     1414     *
     1415     * @covers ::wp_comments_personal_data_exporter
    13111416     */
    13121417    public function test_wp_comments_personal_data_exporter_empty_comment_prop() {
     
    13401445     * @group privacy
    13411446     * @ticket 43440
     1447     *
     1448     * @covers ::wp_comments_personal_data_exporter
    13421449     */
    13431450    public function test_wp_comments_personal_data_exporter_empty_second_page() {
Note: See TracChangeset for help on using the changeset viewer.