mock_objects.php
public function returnsByReferenceAt($timing, $method, &$reference, $args = false)
    {
        $this->dieOnNoMethod($method, 'set return reference sequence');
        $this->actions->registerAt($timing, $method, $args, new SimpleByReference($reference));
    }
public function returnsByReferenceAt($timing, $method, &$reference, $args = false)
    {
        $this->dieOnNoMethod($method, 'set return reference sequence');
        $this->actions->registerAt($timing, $method, $args, new SimpleByReference($reference));
    }
public function returnsByReferenceAt ( $ timing , $ method , & $ reference , $ args = false ) { $ this -> dieOnNoMethod ( $ method , 'set return reference sequence' ) ; $ this -> actions -> registerAt ( $ timing , $ method , $ args , new SimpleByReference ( $ reference ) ) ; }
Sets a return for a parameter list that
will be passed by value only when the required call count is reached.

@param int $timing        Number of calls in the future to which the result applies.
If not set then all calls will return the value.
@param string $method     Method name.
@param mixed $reference   Result of the call will be this object.
@param array $args        List of parameters to match including wildcards.
Sets a return for a parameter list that will be passed by value only when the required call count is reached .