Skip to content

Commit

Permalink
Workaround for ecs issue caused by PHP_CodeSniffer & php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Apr 21, 2021
1 parent 7aaaba5 commit 22171d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
<!-- There is always Unreleased section on the top. Subsections (Added, Changed, Fixed, Removed) should be added as needed. -->

## Unreleased
- `PhpUnitExpectationFixer` is used only on PHP 8.0+ See [symplify#3130](https://github.com/symplify/symplify/issues/3130).

## 3.0.0 - 2021-03-02
- **[BC break]** Change YAML config to PHP. See [UPGRADE-3.0.md](UPGRADE-3.0.md) for step-by-step upgrade howto.
Expand Down
9 changes: 7 additions & 2 deletions ecs.php
Expand Up @@ -444,8 +444,13 @@
$services->set(PhpUnitMockShortWillReturnFixer::class);
// Use expectedException*() methods instead of @expectedException* annotation (both following fixers must be applied to do so)
$services->set(PhpUnitNoExpectationAnnotationFixer::class);
// Usages of ->setExpectedException* methods MUST be replaced by ->expectException* methods
$services->set(PhpUnitExpectationFixer::class);

// Following check fails on PHP <8.0. See https://github.com/symplify/symplify/issues/3130
if (PHP_VERSION_ID >= 80000) {
// Usages of ->setExpectedException* methods MUST be replaced by ->expectException* methods
$services->set(PhpUnitExpectationFixer::class);
}

// Visibility of setUp() and tearDown() method should be kept protected
$services->set(PhpUnitSetUpTearDownVisibilityFixer::class);
// Calls to `PHPUnit\Framework\TestCase` static methods must all be of the same type (`$this->...`)
Expand Down

0 comments on commit 22171d0

Please sign in to comment.