Skip to content
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

Only allow valid return types for willReturn #3673

Merged
merged 11 commits into from May 19, 2019

Conversation

MichelHartmann
Copy link
Contributor

Another enhancement from the code sprint at @flyeralarm in Würzburg:

This fixes: #3122 and #3602

If you would like me to change something before it can merged just give me a hint.

@codecov
Copy link

codecov bot commented Apr 30, 2019

Codecov Report

Merging #3673 into master will increase coverage by 0.22%.
The diff coverage is 96.46%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #3673      +/-   ##
===========================================
+ Coverage     83.08%   83.3%   +0.22%     
- Complexity     3716    3802      +86     
===========================================
  Files           143     154      +11     
  Lines          9779    9940     +161     
===========================================
+ Hits           8125    8281     +156     
- Misses         1654    1659       +5
Impacted Files Coverage Δ Complexity Δ
src/Framework/MockObject/NullType.php 100% <100%> (ø) 3 <3> (?)
src/Framework/MockObject/InvocationMocker.php 76.27% <100%> (ø) 24 <0> (ø) ⬇️
src/Framework/MockObject/ConfigurableMethods.php 100% <100%> (ø) 2 <2> (?)
src/Framework/MockObject/TypeName.php 100% <100%> (ø) 12 <12> (?)
src/Framework/MockObject/MockMethod.php 89.82% <100%> (+2.76%) 50 <8> (-1) ⬇️
src/Framework/MockObject/Type.php 100% <100%> (ø) 18 <18> (?)
src/Framework/MockObject/MockClass.php 100% <100%> (ø) 4 <4> (?)
src/Framework/MockObject/Generator.php 75.78% <100%> (-0.5%) 143 <61> (-1)
.../Framework/MockObject/Builder/InvocationMocker.php 85.56% <100%> (+4.74%) 33 <10> (+9) ⬆️
src/Framework/MockObject/ObjectType.php 100% <100%> (ø) 10 <10> (?)
... and 20 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 544c24c...7a0a7a9. Read the comment docs.

@psalm-shepherd
Copy link

Psalm didn’t find any errors!

@sebastianbergmann sebastianbergmann added event/code-sprint/2019-04 PHPUnit Code Sprint: April 2019 type/enhancement A new idea that should be implemented labels May 6, 2019
@sebastianbergmann sebastianbergmann added this to the PHPUnit 8.2 milestone May 6, 2019
@sebastianbergmann
Copy link
Owner

Thank you, @MichelHartmann. This is a lot to review, I hope I'll get to it soon.

@sebastianbergmann sebastianbergmann merged commit 7a0a7a9 into sebastianbergmann:master May 19, 2019
@sebastianbergmann
Copy link
Owner

@MichelHartmann Sorry that it took so long to merge this. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event/code-sprint/2019-04 PHPUnit Code Sprint: April 2019 type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent runtime type error due to wrong return value configuration
3 participants