Menu

#158 Mock setReturnValue only changes return value on first call

open
Web tester (52)
5
2008-10-05
2008-10-05
chrisvogt
No

A mock objects setReturnValue method only affects the return value the first time it is called.

code:
$mock->setReturnValue( "test", 1 );
$mock->setReturnValue( "test", 2 );
echo $mock->test();

expected result:
2

actual result:
1

Discussion


Log in to post a comment.

MongoDB Logo MongoDB