phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

Allow use of Constraints in ReturnValueMap

Open mstyles opened this issue 6 years ago • 3 comments

One thing that ReturnValueMap lacked was flexibility regarding the arguments the method was invoked with. It works only with exact match As a side effect, if you have floats as arguments, it may fail. As a solution, support has been added for Framework/Constraint objects.

https://github.com/sebastianbergmann/phpunit/issues/3999

mstyles avatar Dec 27 '19 17:12 mstyles

Codecov Report

Merging #4000 into master will decrease coverage by 0.06%. The diff coverage is 94.11%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4000      +/-   ##
============================================
- Coverage      85.5%   85.44%   -0.07%     
- Complexity     3849     3856       +7     
============================================
  Files           156      156              
  Lines          9720     9733      +13     
============================================
+ Hits           8311     8316       +5     
- Misses         1409     1417       +8
Impacted Files Coverage Δ Complexity Δ
src/Framework/MockObject/Stub/ReturnValueMap.php 88% <94.11%> (+4.66%) 14 <7> (+7) :arrow_up:
.../Framework/MockObject/Builder/InvocationMocker.php 90.62% <0%> (-3.13%) 34% <0%> (ø)
src/Util/PHP/AbstractPhpProcess.php 72.78% <0%> (-2.73%) 43% <0%> (ø)

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 2fa8d2e...6afda19. Read the comment docs.

codecov[bot] avatar Dec 27 '19 17:12 codecov[bot]

This branch has conflicts that must be resolved.

sebastianbergmann avatar Sep 19 '20 05:09 sebastianbergmann

@mstyles Hi! This is very helpful pr, check it out please

tweet9ra avatar Oct 11 '21 20:10 tweet9ra

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it.

sebastianbergmann avatar Jan 13 '24 13:01 sebastianbergmann