---
title: "lint/phpunit/require-covers"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/phpunit/require-covers" />

Not in any set. Safe fix. Runs when phpunit is installed.

## What it does

Adds a default `@coversNothing` annotation to PHPUnit test classes that have no `@covers*` annotation.

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/require-covers" = "error"
```

To skip it in some files, add an [override](/docs/configuration/pun-toml#lint) or a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Replaces

- [`php_unit_test_class_requires_covers`](https://cs.symfony.com/doc/rules/php_unit/php_unit_test_class_requires_covers.html) (php-cs-fixer)

[More lint/phpunit rules](/docs/rules/lint/phpunit) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
