Make WordPress Core

Ticket #39265: 39265-more-fixes.patch

File 39265-more-fixes.patch, 7.4 KB (added by jrf, 4 years ago)

Fix newly introduced incorrect @covers tags. When global functions are covered, they need to be prefixed with :: (double colon) to distinguish them from class name. See: https://phpunit.readthedocs.io/en/7.0/annotations.html#covers

  • tests/phpunit/tests/post/wpPublishPosts.php

    From b42fd2b70ce5cdfe2ddd8bae37a4cabbd6042b3a Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sat, 24 Oct 2020 08:48:46 +0200
    Subject: [PATCH] More @covers tags fixes
    
    ---
     tests/phpunit/tests/post/wpPublishPosts.php |  8 ++--
     tests/phpunit/tests/taxonomy.php            |  2 +-
     tests/phpunit/tests/term/termCounts.php     | 42 ++++++++++-----------
     3 files changed, 26 insertions(+), 26 deletions(-)
    
    diff --git a/tests/phpunit/tests/post/wpPublishPosts.php b/tests/phpunit/tests/post/wpPublishPosts.php
    index 42e3884d94..00faaa1656 100644
    a b class Tests_WPPublishPost extends WP_UnitTestCase { 
    4444        /**
    4545         * Ensure wp_publish_post adds default category.
    4646         *
    47          * @covers wp_publish_post
     47         * @covers ::wp_publish_post
    4848         * @ticket 51292
    4949         */
    5050        function test_wp_publish_post_adds_default_category() {
    class Tests_WPPublishPost extends WP_UnitTestCase { 
    6464        /**
    6565         * Ensure wp_publish_post adds default category when tagged.
    6666         *
    67          * @covers wp_publish_post
     67         * @covers ::wp_publish_post
    6868         * @ticket 51292
    6969         */
    7070        function test_wp_publish_post_adds_default_category_when_tagged() {
    class Tests_WPPublishPost extends WP_UnitTestCase { 
    8585        /**
    8686         * Ensure wp_publish_post does not add default term in error.
    8787         *
    88          * @covers wp_publish_post
     88         * @covers ::wp_publish_post
    8989         * @ticket 51292
    9090         */
    9191        function test_wp_publish_post_respects_current_terms() {
    class Tests_WPPublishPost extends WP_UnitTestCase { 
    120120        /**
    121121         * Ensure wp_publish_post adds default term.
    122122         *
    123          * @covers wp_publish_post
     123         * @covers ::wp_publish_post
    124124         * @ticket 51292
    125125         */
    126126        function test_wp_publish_post_adds_default_term() {
  • tests/phpunit/tests/taxonomy.php

    diff --git a/tests/phpunit/tests/taxonomy.php b/tests/phpunit/tests/taxonomy.php
    index b697b17096..5d39d000f1 100644
    a b class Tests_Taxonomy extends WP_UnitTestCase { 
    10491049        /**
    10501050         * Ensure custom callbacks are used when registered.
    10511051         *
    1052          * @covers register_taxonomy
     1052         * @covers ::register_taxonomy
    10531053         * @ticket 40351
    10541054         */
    10551055        function test_register_taxonomy_counting_callbacks() {
  • tests/phpunit/tests/term/termCounts.php

    diff --git a/tests/phpunit/tests/term/termCounts.php b/tests/phpunit/tests/term/termCounts.php
    index 6e197c5d07..be3d0f18f4 100644
    a b class Tests_Term_termCount extends WP_UnitTestCase { 
    8181        /**
    8282         * Term counts are not double incremented when post created.
    8383         *
    84          * @covers wp_modify_term_count_by
     84         * @covers ::wp_modify_term_count_by
    8585         * @dataProvider data_term_count_changes_for_post_statuses
    8686         * @ticket 40351
    8787         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    121121        /**
    122122         * Term counts increments correctly when post status becomes published.
    123123         *
    124          * @covers wp_publish_post
    125          * @covers wp_modify_term_count_by
     124         * @covers ::wp_publish_post
     125         * @covers ::wp_modify_term_count_by
    126126         * @dataProvider data_term_counts_incremented_on_publish
    127127         * @ticket 40351
    128128         * @ticket 51292
    class Tests_Term_termCount extends WP_UnitTestCase { 
    164164        /**
    165165         * Test post status transition update term counts correctly.
    166166         *
    167          * @covers wp_modify_term_count_by
     167         * @covers ::wp_modify_term_count_by
    168168         * @dataProvider data_term_count_transitions_update_term_counts
    169169         * @ticket 40351
    170170         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    230230        /**
    231231         * Term counts are not double incremented when post created.
    232232         *
    233          * @covers wp_modify_term_count_by
     233         * @covers ::wp_modify_term_count_by
    234234         * @dataProvider data_term_count_changes_for_post_statuses_with_attachments
    235235         * @ticket 40351
    236236         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    279279        /**
    280280         * Term counts increments correctly when post status becomes published.
    281281         *
    282          * @covers wp_publish_post
    283          * @covers wp_modify_term_count_by
     282         * @covers ::wp_publish_post
     283         * @covers ::wp_modify_term_count_by
    284284         * @dataProvider data_term_counts_incremented_on_publish_with_attachments
    285285         * @ticket 40351
    286286         * @ticket 51292
    class Tests_Term_termCount extends WP_UnitTestCase { 
    331331        /**
    332332         * Test post status transition update term counts correctly.
    333333         *
    334          * @covers wp_modify_term_count_by
     334         * @covers ::wp_modify_term_count_by
    335335         * @dataProvider data_term_count_transitions_update_term_counts_with_attachments
    336336         * @ticket 40351
    337337         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    406406        /**
    407407         * Term counts are not double incremented when post created.
    408408         *
    409          * @covers wp_modify_term_count_by
     409         * @covers ::wp_modify_term_count_by
    410410         * @dataProvider data_term_count_changes_for_post_statuses_with_untermed_attachments
    411411         * @ticket 40351
    412412         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    454454        /**
    455455         * Term counts increments correctly when post status becomes published.
    456456         *
    457          * @covers wp_modify_term_count_by
    458          * @covers wp_publish_post
     457         * @covers ::wp_modify_term_count_by
     458         * @covers ::wp_publish_post
    459459         * @dataProvider data_term_counts_incremented_on_publish_with_untermed_attachments
    460460         * @ticket 40351
    461461         * @ticket 51292
    class Tests_Term_termCount extends WP_UnitTestCase { 
    505505        /**
    506506         * Test post status transition update term counts correctly.
    507507         *
    508          * @covers wp_modify_term_count_by
     508         * @covers ::wp_modify_term_count_by
    509509         * @dataProvider data_term_count_transitions_update_term_counts_with_untermed_attachments
    510510         * @ticket 40351
    511511         *
    class Tests_Term_termCount extends WP_UnitTestCase { 
    579579        /**
    580580         * User taxonomy term counts increments when added to an account.
    581581         *
    582          * @covers wp_modify_term_count_by
     582         * @covers ::wp_modify_term_count_by
    583583         * @ticket 51292
    584584         */
    585585        public function test_term_counts_user_adding_term() {
    class Tests_Term_termCount extends WP_UnitTestCase { 
    593593        /**
    594594         * User taxonomy term counts decrement when term deleted from user.
    595595         *
    596          * @covers wp_modify_term_count_by
     596         * @covers ::wp_modify_term_count_by
    597597         * @ticket 51292
    598598         */
    599599        public function test_term_counts_user_removing_term() {
    class Tests_Term_termCount extends WP_UnitTestCase { 
    608608        /**
    609609         * Ensure DB queries for deferred counts are nullified for net zero gain.
    610610         *
    611          * @covers wp_modify_term_count_by
    612          * @covers wp_defer_term_counting
     611         * @covers ::wp_modify_term_count_by
     612         * @covers ::wp_defer_term_counting
    613613         * @ticket 51292
    614614         */
    615615        public function test_counts_after_deferral_net_zero() {
    class Tests_Term_termCount extends WP_UnitTestCase { 
    632632        /**
    633633         * Ensure full recounts follow modify by X recounts to avoid miscounts.
    634634         *
    635          * @covers wp_modify_term_count_by
    636          * @covers wp_update_term_count
    637          * @covers wp_defer_term_counting
     635         * @covers ::wp_modify_term_count_by
     636         * @covers ::wp_update_term_count
     637         * @covers ::wp_defer_term_counting
    638638         * @ticket 51292
    639639         */
    640640        public function test_counts_after_deferral_full_before_partial() {
    class Tests_Term_termCount extends WP_UnitTestCase { 
    656656        /**
    657657         * Ensure DB queries for deferred counts are combined.
    658658         *
    659          * @covers wp_modify_term_count_by
    660          * @covers wp_defer_term_counting
     659         * @covers ::wp_modify_term_count_by
     660         * @covers ::wp_defer_term_counting
    661661         * @ticket 51292
    662662         */
    663663        public function test_counts_after_deferral_matching_changes() {