Tests: Correct newly introduced `@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 for more details.

Follow-up to [49000], [49171].

Props jrf.
See #39265.

git-svn-id: https://develop.svn.wordpress.org/trunk@49305 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-10-25 00:31:12 +00:00
parent 715bfc8664
commit 111ebad65e
3 changed files with 26 additions and 26 deletions

View File

@ -44,7 +44,7 @@ class Tests_WPPublishPost extends WP_UnitTestCase {
/**
* Ensure wp_publish_post adds default category.
*
* @covers wp_publish_post
* @covers ::wp_publish_post
* @ticket 51292
*/
function test_wp_publish_post_adds_default_category() {
@ -64,7 +64,7 @@ class Tests_WPPublishPost extends WP_UnitTestCase {
/**
* Ensure wp_publish_post adds default category when tagged.
*
* @covers wp_publish_post
* @covers ::wp_publish_post
* @ticket 51292
*/
function test_wp_publish_post_adds_default_category_when_tagged() {
@ -85,7 +85,7 @@ class Tests_WPPublishPost extends WP_UnitTestCase {
/**
* Ensure wp_publish_post does not add default term in error.
*
* @covers wp_publish_post
* @covers ::wp_publish_post
* @ticket 51292
*/
function test_wp_publish_post_respects_current_terms() {
@ -120,7 +120,7 @@ class Tests_WPPublishPost extends WP_UnitTestCase {
/**
* Ensure wp_publish_post adds default term.
*
* @covers wp_publish_post
* @covers ::wp_publish_post
* @ticket 51292
*/
function test_wp_publish_post_adds_default_term() {

View File

@ -1049,7 +1049,7 @@ class Tests_Taxonomy extends WP_UnitTestCase {
/**
* Ensure custom callbacks are used when registered.
*
* @covers register_taxonomy
* @covers ::register_taxonomy
* @ticket 40351
*/
function test_register_taxonomy_counting_callbacks() {

View File

@ -81,7 +81,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts are not double incremented when post created.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_changes_for_post_statuses
* @ticket 40351
*
@ -121,8 +121,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts increments correctly when post status becomes published.
*
* @covers wp_publish_post
* @covers wp_modify_term_count_by
* @covers ::wp_publish_post
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_counts_incremented_on_publish
* @ticket 40351
* @ticket 51292
@ -164,7 +164,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Test post status transition update term counts correctly.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_transitions_update_term_counts
* @ticket 40351
*
@ -230,7 +230,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts are not double incremented when post created.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_changes_for_post_statuses_with_attachments
* @ticket 40351
*
@ -279,8 +279,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts increments correctly when post status becomes published.
*
* @covers wp_publish_post
* @covers wp_modify_term_count_by
* @covers ::wp_publish_post
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_counts_incremented_on_publish_with_attachments
* @ticket 40351
* @ticket 51292
@ -331,7 +331,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Test post status transition update term counts correctly.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_transitions_update_term_counts_with_attachments
* @ticket 40351
*
@ -406,7 +406,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts are not double incremented when post created.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_changes_for_post_statuses_with_untermed_attachments
* @ticket 40351
*
@ -454,8 +454,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Term counts increments correctly when post status becomes published.
*
* @covers wp_modify_term_count_by
* @covers wp_publish_post
* @covers ::wp_modify_term_count_by
* @covers ::wp_publish_post
* @dataProvider data_term_counts_incremented_on_publish_with_untermed_attachments
* @ticket 40351
* @ticket 51292
@ -505,7 +505,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Test post status transition update term counts correctly.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @dataProvider data_term_count_transitions_update_term_counts_with_untermed_attachments
* @ticket 40351
*
@ -579,7 +579,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* User taxonomy term counts increments when added to an account.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @ticket 51292
*/
public function test_term_counts_user_adding_term() {
@ -593,7 +593,7 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* User taxonomy term counts decrement when term deleted from user.
*
* @covers wp_modify_term_count_by
* @covers ::wp_modify_term_count_by
* @ticket 51292
*/
public function test_term_counts_user_removing_term() {
@ -608,8 +608,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Ensure DB queries for deferred counts are nullified for net zero gain.
*
* @covers wp_modify_term_count_by
* @covers wp_defer_term_counting
* @covers ::wp_modify_term_count_by
* @covers ::wp_defer_term_counting
* @ticket 51292
*/
public function test_counts_after_deferral_net_zero() {
@ -632,9 +632,9 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Ensure full recounts follow modify by X recounts to avoid miscounts.
*
* @covers wp_modify_term_count_by
* @covers wp_update_term_count
* @covers wp_defer_term_counting
* @covers ::wp_modify_term_count_by
* @covers ::wp_update_term_count
* @covers ::wp_defer_term_counting
* @ticket 51292
*/
public function test_counts_after_deferral_full_before_partial() {
@ -656,8 +656,8 @@ class Tests_Term_termCount extends WP_UnitTestCase {
/**
* Ensure DB queries for deferred counts are combined.
*
* @covers wp_modify_term_count_by
* @covers wp_defer_term_counting
* @covers ::wp_modify_term_count_by
* @covers ::wp_defer_term_counting
* @ticket 51292
*/
public function test_counts_after_deferral_matching_changes() {