public function PHPUnit_Framework_MockObject_Stub_ReturnSelf::invoke in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnSelf.php \PHPUnit_Framework_MockObject_Stub_ReturnSelf::invoke()
Fakes the processing of the invocation $invocation by returning a specific value.
Parameters
PHPUnit_Framework_MockObject_Invocation $invocation: The invocation which was mocked and matched by the current method and argument matchers.
Return value
mixed
Overrides PHPUnit_Framework_MockObject_Stub::invoke
File
- vendor/
phpunit/ phpunit-mock-objects/ src/ Framework/ MockObject/ Stub/ ReturnSelf.php, line 18
Class
- PHPUnit_Framework_MockObject_Stub_ReturnSelf
- Stubs a method by returning the current object.
Code
public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) {
if (!$invocation instanceof PHPUnit_Framework_MockObject_Invocation_Object) {
throw new PHPUnit_Framework_Exception('The current object can only be returned when mocking an ' . 'object, not a static class.');
}
return $invocation->object;
}