Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 72b75bb

Browse files
committed
Add various fixers for PHPUnit tests
1 parent 79c8e7b commit 72b75bb

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<!-- There is always Unreleased section on the top. Subsections (Added, Changed, Fixed, Removed) should be added as needed. -->
66

77
## Unreleased
8+
- Add PHPUnit fixers:
9+
- `PhpUnitMockFixer`: Ensure dedicated helper methods `createMock()` and `createPartialMock()` are used where possible instead of `->getMock()`.
10+
- `PhpUnitNoExpectationAnnotationFixer`: Use `setExpectedException()` instead of `@expectedException` annotation.
11+
- `PhpUnitSetUpTearDownVisibilityFixer`: Visibility of `setUp()` and `tearDown()` method should be kept protected as defined in PHPUnit TestCase.
812

913
## 1.0.1 - 2018年04月09日
1014
- Replace deprecated `ExceptionNameFixer` with more generic `ClassNameSuffixByParentFixer`.

‎easy-coding-standard.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ services:
139139
PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer: ~
140140
PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer: ~
141141
PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer: ~
142+
# Use dedicated helper methods createMock() and createPartialMock() where possible
143+
PhpCsFixer\Fixer\PhpUnit\PhpUnitMockFixer: ~
144+
# Use expectedException*() methods instead of @expectedException* annotation (both following fixers must be applied to do so)
145+
PhpCsFixer\Fixer\PhpUnit\PhpUnitNoExpectationAnnotationFixer: ~
146+
PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer: ~
147+
# Visibility of setUp() and tearDown() method should be kept protected
148+
PhpCsFixer\Fixer\PhpUnit\PhpUnitSetUpTearDownVisibilityFixer: ~
142149
PhpCsFixer\Fixer\ReturnNotation\NoUselessReturnFixer: ~
143150
PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer: ~
144151
PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer: ~

‎yaml-sort-checker.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ files:
33
depth: 3
44
excludedKeys:
55
0: parameters
6+
services:
7+
- PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer
68
excludedSections:
79
0: imports
810
yaml-sort-checker.yml:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /