stop using the deprecated at() PHPUnit matcher#37808
Merged
fabpot merged 1 commit intosymfony:3.4from Aug 13, 2020
Merged
Conversation
Member
xabbuh
commented
Aug 12, 2020
| Q | A |
|---|---|
| Branch? | 3.4 |
| Bug fix? | no |
| New feature? | no |
| Deprecations? | no |
| Tickets | Fix #37780 |
| License | MIT |
| Doc PR |
a64e242 to
362c7ed
Compare
Member
|
should be rebased as the first commit (taken from #37771) is now merged |
7e828f7 to
35b5757
Compare
derrabus
reviewed
Aug 12, 2020
| $container->expects($this->at(0))->method('has')->willReturn(false); | ||
| $container->expects($this->at(1))->method('has')->willReturn(true); | ||
| $container->expects($this->at(2))->method('get')->willReturn($twig); | ||
| $container = new ContainerBuilder(); |
Member
There was a problem hiding this comment.
You can use Container instead of ContainerBuilder. Btw, good catch! We shouldn't mock the container. 😃
| private function getContainerMock($services) | ||
| { | ||
| $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock(); | ||
| $container = new ContainerBuilder(); |
| ->withConsecutive( | ||
| ['Notified event "{event}" to listener "{listener}".', ['event' => 'foo', 'listener' => 'closure']], | ||
| ['Notified event "{event}" to listener "{listener}".', ['event' => 'foo', 'listener' => 'closure']] | ||
| ); |
Member
There was a problem hiding this comment.
I wonder if we should just use BufferingLogger instead of mocking the logger.
ogizanagi
approved these changes
Aug 13, 2020
fabpot
approved these changes
Aug 13, 2020
Member
|
Thank you @xabbuh. |
fabpot
added a commit
that referenced
this pull request
Aug 17, 2020
… backwards-compatibility (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [Validator] ensure that the validator is a mock object for backwards-compatibility | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | I accidentally broke the class in #37808. The validator was a mock object before (see the failing tests on the `5.1` branch). Commits ------- 1c9b671 ensure that the validator is a mock object for backwards-compatibility
fabpot
added a commit
that referenced
this pull request
Sep 18, 2020
… BufferingLogger (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [EventDispatcher] drop logger mock in favor of using the BufferingLogger | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #37808 (comment) | License | MIT | Doc PR | Commits ------- 86a7e32 drop logger mock in favor of using the BufferingLogger
xabbuh
added a commit
that referenced
this pull request
Sep 18, 2020
…d exception (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [Intl] fix test by letting mock throw the actual expected exception | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #37808 | License | MIT | Doc PR | This fixes a mistake I made when rewriting the tests in #37808. Commits ------- f6f162d fix test by letting mock throw the actual expected exception
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.