From 8b106a9e54f67b4a3e6cffefc1eedcc37356313c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 2 Sep 2022 00:11:28 +0000 Subject: [PATCH] Tests: Add `@coversNothing` tag for PHP polyfill tests in `phpunit/tests/compat/`. The `@covers` tags for these tests were previously removed to avoid notices when generating the code coverage report on PHP versions where these functions are natively available and not user-defined: {{{ "@covers ::array_key_first" is invalid "@covers ::array_key_last" is invalid "@covers ::hash_hmac" is invalid "@covers ::is_countable" is invalid "@covers ::is_iterable" is invalid "@covers ::mb_strlen" is invalid "@covers ::mb_substr" is invalid "@covers ::str_contains" is invalid "@covers ::str_ends_with" is invalid "@covers ::str_starts_with" is invalid }}} Explicitly including a `@coversNothing` annotation in this case appears to be a more appropriate option than not including any annotation at all. Follow-up to [51852], [52038], [52039], [52040], [54049]. See #39265, #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@54060 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/compat/arrayKeyFirst.php | 2 ++ tests/phpunit/tests/compat/arrayKeyLast.php | 2 ++ tests/phpunit/tests/compat/isCountable.php | 2 ++ tests/phpunit/tests/compat/isIterable.php | 2 ++ tests/phpunit/tests/compat/strContains.php | 2 ++ tests/phpunit/tests/compat/strEndsWith.php | 2 ++ tests/phpunit/tests/compat/strStartsWith.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/tests/phpunit/tests/compat/arrayKeyFirst.php b/tests/phpunit/tests/compat/arrayKeyFirst.php index 385fbb0b37..2feae8e250 100644 --- a/tests/phpunit/tests/compat/arrayKeyFirst.php +++ b/tests/phpunit/tests/compat/arrayKeyFirst.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_arrayKeyFirst extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/arrayKeyLast.php b/tests/phpunit/tests/compat/arrayKeyLast.php index a4f096e1bd..c41e05ca0f 100644 --- a/tests/phpunit/tests/compat/arrayKeyLast.php +++ b/tests/phpunit/tests/compat/arrayKeyLast.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_ArrayKeyLast extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/isCountable.php b/tests/phpunit/tests/compat/isCountable.php index 6d7245ec37..e533cd7afa 100644 --- a/tests/phpunit/tests/compat/isCountable.php +++ b/tests/phpunit/tests/compat/isCountable.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_isCountable extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/isIterable.php b/tests/phpunit/tests/compat/isIterable.php index f198eeebe0..e78b7c3913 100644 --- a/tests/phpunit/tests/compat/isIterable.php +++ b/tests/phpunit/tests/compat/isIterable.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_isIterable extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/strContains.php b/tests/phpunit/tests/compat/strContains.php index 712b71c25d..6a794851d7 100644 --- a/tests/phpunit/tests/compat/strContains.php +++ b/tests/phpunit/tests/compat/strContains.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_strContains extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/strEndsWith.php b/tests/phpunit/tests/compat/strEndsWith.php index e3c883d1fb..18f9d6f824 100644 --- a/tests/phpunit/tests/compat/strEndsWith.php +++ b/tests/phpunit/tests/compat/strEndsWith.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_StrEndsWith extends WP_UnitTestCase { diff --git a/tests/phpunit/tests/compat/strStartsWith.php b/tests/phpunit/tests/compat/strStartsWith.php index 759547d9d6..cbe926c662 100644 --- a/tests/phpunit/tests/compat/strStartsWith.php +++ b/tests/phpunit/tests/compat/strStartsWith.php @@ -2,6 +2,8 @@ /** * @group compat + * + * @coversNothing */ class Tests_Compat_StrStartsWith extends WP_UnitTestCase {