Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

imp: willYield handle Generator::getReturn() #507

Merged

Conversation

camilledejoye
Copy link
Contributor

@camilledejoye camilledejoye commented Oct 24, 2020

The current implementation of MethodProphecy::willYield() does not allow to specify a return value for the mocked generator.

The proposal here is to add an optional parameter allowing to define the return value:

$prophecy->createGenerator()->willYield(['foo', 'bar'], 'return value');

@camilledejoye camilledejoye force-pushed the imp/will-yield-handle-return branch from 66d111a to 4266f21 Compare November 22, 2020 14:17
@ciaranmcnulty
Copy link
Member

Looks good, thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants