mock_objects.php
public function returnsByReference($method, &$reference, $args = false)
    {
        $this->dieOnNoMethod($method, 'set return reference');
        $this->actions->register($method, $args, new SimpleByReference($reference));
    }
public function returnsByReference($method, &$reference, $args = false)
    {
        $this->dieOnNoMethod($method, 'set return reference');
        $this->actions->register($method, $args, new SimpleByReference($reference));
    }
public function returnsByReference ( $ method , & $ reference , $ args = false ) { $ this -> dieOnNoMethod ( $ method , 'set return reference' ) ; $ this -> actions -> register ( $ method , $ args , new SimpleByReference ( $ reference ) ) ; }
Sets a return for a parameter list that will be passed by reference for all calls.

@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 reference for all calls .