Php-cs-fixer: [Feature Request] PHP Unit @test annotation (or not)

Created on 24 Nov 2017  Â·  4Comments  Â·  Source: FriendsOfPHP/PHP-CS-Fixer

PHP Unit accepts the following as tests.

    /**
     * @test
     */
    public function seeIfItWorks() {...}

or

    public function testSeeIfItWorks() {...}

I'd like to see a rule that enforces one or the other, so either remove test from the function name and add @test annotation, or remove @test annotation, and add test in front of the function name. (And also make sure the function is properly camel cased again.)

kinfeature request

Most helpful comment

I'm playing around with it now, and i'll try and make a PR out of this when its ready.

All 4 comments

Hi.
I think it is a good idea indeed.
Please, could you raise a PR ?

I'm playing around with it now, and i'll try and make a PR out of this when its ready.

Since this was merged in #3275 i think this can be closed

Was this page helpful?
0 / 5 - 0 ratings