Go\Aop\Framework\AroundInterceptorTest::testInvocationIsCalledWithinAdvice PHP Method

testInvocationIsCalledWithinAdvice() public method

    public function testInvocationIsCalledWithinAdvice()
    {
        $sequence = [];
        $advice = function (Invocation $invocation) use(&$sequence) {
            $sequence[] = 'advice';
            $result = $invocation->proceed();
            $sequence[] = 'advice';
            return $result;
        };
        $invocation = $this->getInvocation($sequence);
        $interceptor = new AroundInterceptor($advice);
        $result = $interceptor->invoke($invocation);
        $this->assertEquals('invocation', $result, "Advice should return an original return value");
        $this->assertEquals(array('advice', 'invocation', 'advice'), $sequence, "Around logic should work");
    }