Refactoring tests#25420
Merged
nicolas-grekas merged 1 commit intosymfony:2.7from Dec 12, 2017
carusogabriel:refactoring-tests
Merged
Refactoring tests#25420nicolas-grekas merged 1 commit intosymfony:2.7from carusogabriel:refactoring-tests
nicolas-grekas merged 1 commit intosymfony:2.7from
carusogabriel:refactoring-tests
Conversation
OskarStark
approved these changes
Dec 11, 2017
Member
|
such changes should be done in 2.7 first (and then additional PRs for 2.8, 3.3, 3.4, 4.0 and master with the necessary additional changes after things have been propagated each time). |
Contributor
Author
|
@stof @nicolas-grekas @OskarStark Should I replicate this PR to each branch? Isn't there a better way? |
Member
|
@carusogabriel Doing one PR on 2.7 is enough for now. |
Contributor
Author
|
@fabpot Gonna work on that! |
Contributor
Author
|
Done! I've also added:
|
Member
|
Thank you @carusogabriel. |
nicolas-grekas
added a commit
that referenced
this pull request
Dec 12, 2017
This PR was merged into the 2.7 branch. Discussion ---------- Refactoring tests | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I've refactored some tests, using: - `assertCount` instead of `count` function; - `assertArrayHasKey`, `assertArrayNotHasKey`, `assertObjectHasAttribute` and `assertObjectNotHasAttribute` instead of `isset` function; - `assertContains` instead of `in_array` function; - `assertSame` and `assertNotSame` instead os strict comparisons `===`; - `assertNotFalse` instead of strict comparisons `!==` with `false` keyword; - `assertGreaterThan`, `assertLessThan` and `assertLessThanOrEqual` for mathematical comparisons; Commits ------- 567e0ab Refactoring tests.
nicolas-grekas
added a commit
that referenced
this pull request
Dec 12, 2017
This PR was merged into the 3.3 branch. Discussion ---------- [HttpFoundation] Fix tests | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | not yet | Fixed tickets | n/a | License | MIT | Doc PR | n/a Remains filesystem ones due to #25420, going to have a look in this PR in the next hour if nobody does before. Commits ------- ef6adb8 Fix tests
nicolas-grekas
added a commit
that referenced
this pull request
Dec 20, 2017
This PR was merged into the 2.7 branch. Discussion ---------- Add php_unit_dedicate_assert to PHPCS | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25420 | License | MIT | Doc PR | - Forgot to add this in #25420 😅 Commits ------- e913b68 Add php_unit_dedicate_assert to PHPCS
fabpot
added a commit
that referenced
this pull request
Jan 29, 2018
This PR was merged into the 2.7 branch. Discussion ---------- Improve assertions | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Following #25420 before start other branches. Btw, the other branches are 2.8, 3.3, 3.4, 4.0 and master? Commits ------- 3d90a22 Improve assertions
fabpot
added a commit
that referenced
this pull request
Jan 29, 2018
This PR was merged into the 2.8 branch. Discussion ---------- Improve assertions | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Following #25420 in `2.8` branch. Commits ------- 4683f6d Improve assertions
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Feb 4, 2018
This PR was merged into the 3.4 branch. Discussion ---------- Improve assertions | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Following #25420 in `3.4` branch. Commits ------- 829f59d Improve assertions
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've refactored some tests, using:
assertCountinstead ofcountfunction;assertArrayHasKey,assertArrayNotHasKey,assertObjectHasAttributeandassertObjectNotHasAttributeinstead ofissetfunction;assertContainsinstead ofin_arrayfunction;assertSameandassertNotSameinstead os strict comparisons===;assertNotFalseinstead of strict comparisons!==withfalsekeyword;assertGreaterThan,assertLessThanandassertLessThanOrEqualfor mathematical comparisons;