phpunit-documentation-english icon indicating copy to clipboard operation
phpunit-documentation-english copied to clipboard

Naming convention of data provider methods

Open Kwadz opened this issue 5 years ago • 1 comments

As we can see in the data providers section the data provider method is named additionProvider. Since a method should start with a verb, it's confusing. So, to avoid a bad practice in projects because of this example, I'd suggest renaming it to provideAddition.

If agreed, I'm ready to create a pull request.

Kwadz avatar Jun 15 '20 10:06 Kwadz

there are some concrete patterns how to name providers used by some, eg testFoo -> provideFooCases

maybe the docs should try to not only avoid "bad practice", but share "best practice" (whatever it would be)

keradus avatar Jul 20 '20 07:07 keradus

I do not think that this should be covered in the documentation.

sebastianbergmann avatar Feb 23 '23 06:02 sebastianbergmann