From 617224515785d89a6ce227e67ef3505c164119ef Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 8 Apr 2023 16:36:14 +0200 Subject: [PATCH] Tests: add `@covers` tags for abstract base sniff classes As the abstract sniff base classes in WPCS do not have dedicated tests, but are tested via the sniffs using them, I'm adding `@covers` tags for these to select sniffs. As the majority of these will at some point in the future be replaced by (fully tested) abstracts from PHPCSUtils, I'm not concerned with adding dedicated tests for these, so this will do until they are deprecated/removed. --- WordPress/Tests/DB/RestrictedClassesUnitTest.php | 1 + WordPress/Tests/DB/SlowDBQueryUnitTest.php | 1 + WordPress/Tests/PHP/StrictInArrayUnitTest.php | 1 + WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php | 1 + WordPress/Tests/WP/PostsPerPageUnitTest.php | 1 + 5 files changed, 5 insertions(+) diff --git a/WordPress/Tests/DB/RestrictedClassesUnitTest.php b/WordPress/Tests/DB/RestrictedClassesUnitTest.php index 1623e68682..1ee99d0840 100644 --- a/WordPress/Tests/DB/RestrictedClassesUnitTest.php +++ b/WordPress/Tests/DB/RestrictedClassesUnitTest.php @@ -21,6 +21,7 @@ * @since 0.13.0 Class name changed: this class is now namespaced. * @since 3.0.0 Renamed the fixtures to create compatibility with PHPCS 4.x/PHPUnit >=8. * + * @covers \WordPressCS\WordPress\AbstractClassRestrictionsSniff * @covers \WordPressCS\WordPress\Helpers\RulesetPropertyHelper * @covers \WordPressCS\WordPress\Sniffs\DB\RestrictedClassesSniff */ diff --git a/WordPress/Tests/DB/SlowDBQueryUnitTest.php b/WordPress/Tests/DB/SlowDBQueryUnitTest.php index 82b1c9aaae..94aa230564 100644 --- a/WordPress/Tests/DB/SlowDBQueryUnitTest.php +++ b/WordPress/Tests/DB/SlowDBQueryUnitTest.php @@ -20,6 +20,7 @@ * @since 0.13.0 Class name changed: this class is now namespaced. * @since 1.0.0 This sniff has been moved from the `VIP` category to the `DB` category. * + * @covers \WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff * @covers \WordPressCS\WordPress\Sniffs\DB\SlowDBQuerySniff */ final class SlowDBQueryUnitTest extends AbstractSniffUnitTest { diff --git a/WordPress/Tests/PHP/StrictInArrayUnitTest.php b/WordPress/Tests/PHP/StrictInArrayUnitTest.php index 6f5225a65a..c430d94a34 100644 --- a/WordPress/Tests/PHP/StrictInArrayUnitTest.php +++ b/WordPress/Tests/PHP/StrictInArrayUnitTest.php @@ -19,6 +19,7 @@ * @since 0.9.0 * @since 0.13.0 Class name changed: this class is now namespaced. * + * @covers \WordPressCS\WordPress\AbstractFunctionParameterSniff * @covers \WordPressCS\WordPress\Sniffs\PHP\StrictInArraySniff */ final class StrictInArrayUnitTest extends AbstractSniffUnitTest { diff --git a/WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php b/WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php index fbb88b14e1..93827ee355 100644 --- a/WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php +++ b/WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php @@ -19,6 +19,7 @@ * @since 0.11.0 * @since 0.13.0 Class name changed: this class is now namespaced. * + * @covers \WordPressCS\WordPress\AbstractFunctionRestrictionsSniff * @covers \WordPressCS\WordPress\Sniffs\WP\DiscouragedFunctionsSniff */ final class DiscouragedFunctionsUnitTest extends AbstractSniffUnitTest { diff --git a/WordPress/Tests/WP/PostsPerPageUnitTest.php b/WordPress/Tests/WP/PostsPerPageUnitTest.php index ef848320d2..42ea579a78 100644 --- a/WordPress/Tests/WP/PostsPerPageUnitTest.php +++ b/WordPress/Tests/WP/PostsPerPageUnitTest.php @@ -22,6 +22,7 @@ * limit being part of the WP category, and the check for pagination * disabling being part of the VIP category. * + * @covers \WordPressCS\WordPress\AbstractArrayAssignmentRestrictionsSniff * @covers \WordPressCS\WordPress\Sniffs\WP\PostsPerPageSniff */ final class PostsPerPageUnitTest extends AbstractSniffUnitTest {