Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

returnValueMap #31

Closed
sebastianbergmann opened this issue Jan 11, 2011 · 2 comments
Closed

returnValueMap #31

sebastianbergmann opened this issue Jan 11, 2011 · 2 comments

Comments

@sebastianbergmann
Copy link
Owner

Building on the idea from http://giorgiosironi.blogspot.com/2010/03/clever-mock-objects-with-phpunit.html the following should be possible

$map   = array();
$map[] = array('a', 'b', 'c', 'd');

$stub->expects($this->any())
     ->method('doSomething')
     ->will($this->returnValueMap($map));

$this->assertEquals('d', $stub->doSomething('a', 'b', 'c'));
@whatthejeff
Copy link
Collaborator

This can probably by closed now that #53 was pulled.

@sebastianbergmann
Copy link
Owner Author

Indeed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants