Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AbstractConfigTestCase #4413

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@Slamdunk
Copy link
Contributor

commented May 14, 2019

This test enforces a project to have all the fixers specified, either active or not, so it's always up to date. This can be viewed as a more aggressive form of #3047.

Usage:

final class ConfigTest extends \PhpCsFixer\Test\AbstractConfigTestCase
{
    public function testPhpCsFixerConfigIsUpToDate()
    {
        $this->doTestAllDefaultRulesAreSpecified(require dirname(__DIR__) . '/.php_cs');
    }
}
  • Check all rules are specified, either by name or RuleSet
  • Check all specified rules exist and are not deprecated
  • Check all rules are ordered alphabetically

It's 2 years I use this test in my project (for example in Slamdunk/php-cs-fixer-extensions) and is sooo useful.

If you like it, I'll update the README too.

Slamdunk added some commits May 14, 2019

@Slamdunk

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

1) PhpCsFixer\Tests\AutoReview\ComposerTest::testBranchAlias
Failed asserting that Array &0 (
    'dev-master' => '2.15-dev'
) is identical to Array &0 (
    'dev-master' => '2.16-dev'
).

immagine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.