Closed creynders closed 11 years ago
Apologies for the very late response.
This is very true. That API could have been better.
I recommend using the received()
matcher instead:
[Test]
public function test_parsePlayerFromData_doesNotUpdateModelWhenReceivedNullish() : void {
instance.parsePlayerFromData( null );
assertThat( mockPlayersModel, received().method( 'addPlayer' ).never() );
}
Hey @drewbourne thanks for responding though, even if it was a little late :smile: I figured that one already out in the mean time though. Working on Robotlegs really made me appreciate mockolate. It rocks, although it's a bit opaque here and there.
I've got the following code in a test:
And although the addPlayer method is never called I get the following error in the runner: