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 functionality to Stub to allow ConsecutiveCallStub #1300

Merged
merged 2 commits into from Aug 14, 2014

Conversation

@nathanmac
Copy link
Contributor

@nathanmac nathanmac commented Aug 14, 2014

Add functionality to support ConsecutiveCallStub - PHPUnit via the Stub Class

  • Useful for testing recursive functions
<?php
    $user = Stub::make('User', array('getName' => Stub::consecutive('david', 'emma', 'sam', 'amy')));
    $user->getName(); //david
    $user->getName(); //emma
    $user->getName(); //sam
    $user->getName(); //amy
?>

http://phpunit.de/manual/3.6/en/test-doubles.html#test-doubles.stubs.examples.StubTest7.php

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Aug 14, 2014

Great! Thank you

DavertMik added a commit that referenced this pull request Aug 14, 2014
Add functionality to Stub to allow ConsecutiveCallStub
@DavertMik DavertMik merged commit b598f36 into Codeception:2.0 Aug 14, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@DavertMik DavertMik added this to the 2.0.5 milestone Aug 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.