Neos\Flow\Security\Authorization\Interceptor\AfterInvocation::setResult PHP Method

setResult() public method

Sets the result (return object) of the intercepted method
public setResult ( mixed $result ) : void
$result mixed The result of the intercepted method
return void
    public function setResult($result)
    {
        $this->result = $result;
    }

Usage Example

 /**
  * @test
  */
 public function invokeReturnsTheResultPreviouslySetBySetResultIfTheMethodIsNotIntercepted()
 {
     $mockSecurityContext = $this->createMock(Security\Context::class);
     $mockAfterInvocationManager = $this->createMock(Security\Authorization\AfterInvocationManagerInterface::class);
     $theResult = new \ArrayObject(['some' => 'stuff']);
     $interceptor = new Security\Authorization\Interceptor\AfterInvocation($mockSecurityContext, $mockAfterInvocationManager);
     $interceptor->setResult($theResult);
     $this->assertSame($theResult, $interceptor->invoke());
 }