diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b30845046c..e9af9149ca 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -384,6 +384,8 @@ To run the tests specific to the use of `PHP_CODESNIFFER_CBF === true`: In such cases, the `PHP_CodeSniffer\Tests\Core\Config\AbstractRealConfigTestCase` should be used as the base test class. * Tests for the `Runner` class often can't create their own `Config` object in the tests, so run into the same issue. Those tests should use the `PHP_CodeSniffer\Tests\Core\Runner\AbstractRunnerTestCase` base class, which will ensure the Config is clean. +* When using data providers, define them immediately below the corresponding test method. +* When a test method has only one data provider, it is considered best practice to closely couple the test and data provider methods via their names. I.e. the data provider's name should match the test method name, replacing the "test" prefix with "data". For example, the data provider for a method named `testSomething()` should be `dataSomething()`. ### Submitting Your Pull Request