Skip to content

Refactor mock runtime #3849

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

Conversation

MichelHartmann
Copy link
Contributor

Refactored runtime code for mocks.

  • The old "Matchers" are separated into three responsibilities:
    • method invocation
    • parameters
    • method name
  • Some interfaces that were used only by a single class are removed.
  • Renamed some concepts to better reflect what they are doing

* The old "Matchers" are separated into three responsibilities:
** method invocation
** parameters
** method name
* Some interfaces that were used only by a single class are removed.
* Renamed some concepts to better reflect what they are doing
@codecov
Copy link

codecov bot commented Sep 7, 2019

Codecov Report

Merging #3849 into master will increase coverage by 0.19%.
The diff coverage is 73.01%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #3849      +/-   ##
===========================================
+ Coverage      83.1%   83.3%   +0.19%     
+ Complexity     3853    3847       -6     
===========================================
  Files           153     151       -2     
  Lines         10213   10198      -15     
===========================================
+ Hits           8488    8495       +7     
+ Misses         1725    1703      -22
Impacted Files Coverage Δ Complexity Δ
src/Framework/TestCase.php 80.79% <ø> (ø) 338 <0> (ø) ⬇️
src/Framework/MockObject/Api/Method.php 100% <ø> (ø) 1 <0> (ø) ⬇️
src/Framework/MockObject/Matcher/MethodName.php 91.66% <ø> (ø) 6 <0> (ø) ⬇️
...rc/Framework/MockObject/Matcher/InvokedAtIndex.php 57.14% <100%> (ø) 6 <1> (ø) ⬇️
...ework/MockObject/Matcher/ConsecutiveParameters.php 82.92% <100%> (-7.55%) 14 <1> (ø)
src/Framework/MockObject/Matcher/Parameters.php 82.6% <100%> (-0.38%) 18 <2> (ø)
...c/Framework/MockObject/Matcher/AnyInvokedCount.php 100% <100%> (ø) 4 <2> (+2) ⬆️
...c/Framework/MockObject/Api/UnmockedCloneMethod.php 100% <100%> (ø) 1 <0> (ø) ⬇️
src/Framework/MockObject/Matcher/InvokedCount.php 80.64% <100%> (+0.64%) 10 <7> (+1) ⬆️
...ramework/MockObject/Matcher/InvokedAtMostCount.php 61.53% <100%> (+11.53%) 6 <2> (+2) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 794e25a...eb1c3c6. Read the comment docs.

@sebastianbergmann sebastianbergmann added the event/code-sprint/2019-09 PHPUnit Code Sprint: September 2019 label Sep 7, 2019
@sebastianbergmann
Copy link
Owner

I think we can safely ignore the API breaks that this refactoring introduces.

@sebastianbergmann sebastianbergmann merged commit dfad470 into sebastianbergmann:master Sep 7, 2019
sebastianbergmann added a commit that referenced this pull request Sep 7, 2019
@MichelHartmann MichelHartmann deleted the refactor-mock-runtime branch September 9, 2019 06:15
@mickaelandrieu
Copy link

I think we can safely ignore the API breaks that this refactoring introduces.

I know these classes are not covered in any way by the BC Break, but I'm wondering what we can do to replace the use of getInvocations method of the AnyInvokedCount class ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event/code-sprint/2019-09 PHPUnit Code Sprint: September 2019
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants