moodlehq / moodle-cs

Moodle Coding Style
https://github.com/moodlehq/moodle-cs
GNU General Public License v3.0
18 stars 16 forks source link

TestCaseProviderSniff does not detect data provider method "class::provider" #163

Open ziegenberg opened 5 months ago

ziegenberg commented 5 months ago

You can share data providers between separate unit tests with:

    /**
     * Test something.
     *
     * @dataProvider \some\class\test_class::test_provider
     */
    public function test_something(){}

This generates the error message: Data provider method "\some\class\test_class::test_provider" not found.

stronk7 commented 5 months ago

I personally don't like shared data providers. Specially when we don't autoload unit tests and that may break one by one isolated execution by adding inter dependencies between tests.

Surely we can easily skip the error/warning if the FQCN of the class is "remote", but still I'm not completely sold to the idea.

Just saying, my very own opinion. :-)