Php-cs-fixer: PHPUnit70Migration ruleset

Created on 6 Feb 2018  路  3Comments  路  Source: FriendsOfPHP/PHP-CS-Fixer

One of the changes in phpunit 7.0 is that @test annotation is checked a bit more strict. This means that

/**
 * Big @test, Only run if you have time
 */

Is no longer accepted as test annotation.

I propose a fixer that would change this into

/**
 * @test
 * Big @test, Only run if you have time
 */

This should probably be a risky fixer, since it might change functions that you don't want to be tests into tests.
See: https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-7.0.md

kinfeature request

Most helpful comment

Another thing is that methods like setUp, setUpBeforeClass, tearDown and tearDownAfterClass must declare void as return type. There are some more signature changes listed here: https://phpunit.de/announcements/phpunit-7.html

All 3 comments

I guess this could be implemented as well:

@scenario is no longer an alias for @test

@BackEndTea sounds like great idea, could you create a PR ?

Another thing is that methods like setUp, setUpBeforeClass, tearDown and tearDownAfterClass must declare void as return type. There are some more signature changes listed here: https://phpunit.de/announcements/phpunit-7.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bilge picture Bilge  路  3Comments

datenmeister picture datenmeister  路  3Comments

UksusoFF picture UksusoFF  路  3Comments

vitek-rostislav picture vitek-rostislav  路  3Comments

aidantwoods picture aidantwoods  路  3Comments