PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

Rename data providers from `xyzDataProvider` to `provideXyz`

Open oliverklee opened this issue 2 years ago • 4 comments

oliverklee avatar Feb 11 '24 13:02 oliverklee

Also, while on #456, it seemed to make sense to move all the data providers before the tests:

  • Some data providers were used for more than one test, so could not be easily grouped with the relevant test;
  • Data providers are static, tests are not, also suggested grouping data separately from tests (though within the same file)
    • My personal coding style is to have all statics before non-statics within a similar classification (still properties before methods - don't know if that's covered by any standard);
  • For readability, it seems logical to present the data first:
    • This is the data we're going to use for testing;
    • Now this is what were going to use it for.

WDYT?

JakeQZ avatar Feb 14 '24 01:02 JakeQZ

I'm fine with this. I'd prefer to to have the data provider directly above the first test that uses is to reduce scrolling.

oliverklee avatar Feb 14 '24 07:02 oliverklee

I just spotted the dxsleyia test in the title.

JakeQZ avatar Feb 15 '24 03:02 JakeQZ

I'd prefer to to have the data provider directly above the first test that uses is to reduce scrolling.

Agree. Though In an ideal world where classes are small, that wouldn't be necessary :)

JakeQZ avatar Feb 15 '24 03:02 JakeQZ