mageekguy\atoum\mock\php\method::returnReference PHP Method

returnReference() public method

public returnReference ( )
    public function returnReference()
    {
        if ($this->isConstructor === true) {
            throw new exceptions\logic('Constructor can not return a reference');
        }
        $this->returnReference = true;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testReturnReference()
 {
     $method = new php\method(uniqid());
     $this->assert->object($method->returnReference())->isIdenticalTo($method);
     $method = new php\method('__construct');
     $this->assert->exception(function () use($method) {
         $method->returnReference();
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Constructor can not return a reference');
 }