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

Add ability to combine onlyMethods and addMethod #3920

Conversation

bikalbasnet
Copy link
Contributor

Related Issue: one of the issue from #3911
Re Open of PR #3907

This PR gives the ability to combine two new methods onlyMethods and addMethods
so we can write UTs like this

$this->getMockBuilder(SomeClass::class)
    ->onlyMethods(['aMethodThatExists'])
    ->addMethods(['aMethodThatDoesNotExist']);

@bikalbasnet bikalbasnet changed the title Combine only methods and add methods Add ability to combine onlyMethods and addMethod Oct 30, 2019
@codecov
Copy link

codecov bot commented Oct 30, 2019

Codecov Report

Merging #3920 into master will increase coverage by 0.21%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3920      +/-   ##
============================================
+ Coverage     83.72%   83.94%   +0.21%     
- Complexity     3856     3909      +53     
============================================
  Files           151      151              
  Lines         10218    10369     +151     
============================================
+ Hits           8555     8704     +149     
- Misses         1663     1665       +2
Impacted Files Coverage Δ Complexity Δ
src/Framework/MockObject/MockBuilder.php 61.11% <100%> (-2.76%) 36 <3> (ø)
src/Framework/MockObject/Generator.php 83.93% <100%> (ø) 145 <10> (ø) ⬇️
src/TextUI/Help.php 100% <0%> (ø) 50% <0%> (+25%) ⬆️
src/Runner/PhptTestCase.php 83.6% <0%> (+0.65%) 109% <0%> (ø) ⬇️
src/Framework/TestSuite.php 78.54% <0%> (+2.29%) 130% <0%> (+15%) ⬆️
src/Util/Log/JUnit.php 94.11% <0%> (+3.79%) 47% <0%> (+13%) ⬆️

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 dfdb50f...adc1a00. Read the comment docs.

@sebastianbergmann sebastianbergmann merged commit dd3f604 into sebastianbergmann:master Oct 31, 2019
@sebastianbergmann sebastianbergmann added the feature/test-doubles Stubs and Mock Objects label Oct 31, 2019
@sebastianbergmann sebastianbergmann added this to the PHPUnit 8.5 milestone Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-doubles Stubs and Mock Objects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants