Reputation: 148
I'm looking for an equivalent to this:
$stub->expects($this->any())
->method('doSomething')
->will($this->returnArgument(0));
see: How to return the argument of a mocked method?
Is there anything similar to this in Mockery?
Upvotes: 1
Views: 587
Reputation: 7238
Try it using a closure
Mockery::mock('SomeClass')
->shouldReceive('doSomething')
->andReturnUsing(function($arg) {
return $arg;
})
->mock();
Upvotes: 4