sebastianbergmann/phpunit — Issue #404: returnValueMap only works with at least 3 input parameters
Author: miertschink
Created: 2011-11-11 13:00:19+00:00
State: open

I'm trying to use returnValueMap as described here:
http://www.phpunit.de/manual/3.6/en/test-doubles.html#test-doubles.stubs.examples.StubTest5.php

It seems that it only works when using 4 elements in the array's
when trying like this:

$map = array(
array('foo', 'bar'),
);

$myClass= $this->getMock('myClass');
$myClass->expects($this->any())
->method('myMethod')
->will($this->returnValueMap($map));

It doesn't work...
a dump of $invocation->parameters in method 'invoke' of class PHPUnit_Framework_MockObject_Stub_ReturnValueMap
comes up with

array(3) {
[0]=>
string(11) "foo"
[1]=>
NULL
[2]=>
bool(false)
}

why are there NULL and false added?