---
title: "lint/phpunit/require-data-provider-order"
pagination: false
---

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

<RuleId id="lint/phpunit/require-data-provider-order" />

In the [`coding-style`](/docs/rules/sets/coding-style) set. Safe fix. Runs when phpunit is installed.

## What it does

Data provider method must be placed after/before the last/first test where used.

## Configuration

```toml title="pun.toml"
[lint.rules]
"phpunit/require-data-provider-order" = "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.

## Options

| Name | Type | Allowed values | Default | Upstream name |
| --- | --- | --- | --- | --- |
| `placement` | `enum` | `after`, `before` | `"after"` | `placement` |

## Replaces

- [`php_unit_data_provider_method_order`](https://cs.symfony.com/doc/rules/php_unit/php_unit_data_provider_method_order.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)
