@package PHPUnit_MockObject @author Sebastian Bergmann <sb@sebastian-bergmann.de> @copyright 2010-2013 Sebastian Bergmann <sb@sebastian-bergmann.de> @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License @version Release: @package_version@ @link http://github.com/sebastianbergmann/phpunit-mock-objects @since Class available since Release 1.0.0
Expanded class hierarchy of PHPUnit_Framework_MockObject_Stub_ReturnCallback
class PHPUnit_Framework_MockObject_Stub_ReturnCallback implements PHPUnit_Framework_MockObject_Stub {
protected $callback;
public function __construct($callback) {
$this->callback = $callback;
}
public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation) {
return call_user_func_array($this->callback, $invocation->parameters);
}
public function toString() {
if (is_array($this->callback)) {
if (is_object($this->callback[0])) {
$class = get_class($this->callback[0]);
$type = '->';
}
else {
$class = $this->callback[0];
$type = '::';
}
return sprintf('return result of user defined callback %s%s%s() with the ' . 'passed arguments', $class, $type, $this->callback[1]);
}
else {
return 'return result of user defined callback ' . $this->callback . ' with the passed arguments';
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PHPUnit_Framework_MockObject_Stub_ReturnCallback:: |
protected | property | ||
PHPUnit_Framework_MockObject_Stub_ReturnCallback:: |
public | function |
Fakes the processing of the invocation $invocation by returning a
specific value. Overrides PHPUnit_Framework_MockObject_Stub:: |
|
PHPUnit_Framework_MockObject_Stub_ReturnCallback:: |
public | function |
Returns a string representation of the object. Overrides PHPUnit_Framework_SelfDescribing:: |
|
PHPUnit_Framework_MockObject_Stub_ReturnCallback:: |
public | function |