PHPCSStandards / PHPCSUtils

A suite of utility functions for use with PHP_CodeSniffer
https://phpcsutils.com/
GNU Lesser General Public License v3.0
54 stars 7 forks source link

Tests/FindExtendedClassNameTest: sync with upstream #539

Closed jrfnl closed 10 months ago

jrfnl commented 10 months ago

Sister-PR to PHPCSStandards/PHP_CodeSniffer#212

Tests/FindExtendedClassNameTest: sync with upstream [1] - improve test markers

Make the test marker names more descriptive

Tests/FindExtendedClassNameTest: sync with upstream [2] - use named data sets

With non-named data sets, when a test fails, PHPUnit will display the number of the test which failed.

With tests which have a lot of data sets, this makes it interesting (and time-consuming) to debug those, as one now has to figure out which of the data sets in the data provider corresponds to that number.

Using named data sets makes debugging failing tests more straight forward as PHPUnit will display the data set name instead of the number.

Aside from adding the data set name, this commit also adds the parameter name for each item in the data set, this time in an effort to make it more straight forward to update and add tests as it will be more obvious what each key in the data set signifies.

Includes fixing the data types in the docblocks and making them more specific, where relevant.

Tests/FindExtendedClassNameTest: sync with upstream [3] - more logical test order

This cleans up the test case file a little by removing some code which isn't actually used in the tests and moves some tests