Skip to content

Commit

Permalink
Tests: add @covers tags for abstract base sniff classes
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrfnl committed Apr 17, 2023
1 parent 391caea commit 6172245
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions WordPress/Tests/DB/RestrictedClassesUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions WordPress/Tests/DB/SlowDBQueryUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions WordPress/Tests/PHP/StrictInArrayUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions WordPress/Tests/WP/DiscouragedFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions WordPress/Tests/WP/PostsPerPageUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6172245

Please sign in to comment.