Neos\Flow\Tests\Unit\Aop\Advice\AbstractAdviceTest::invokeInvokesTheAdviceIfTheRuntimeEvaluatorReturnsTrue PHP Method

invokeInvokesTheAdviceIfTheRuntimeEvaluatorReturnsTrue() public method

    public function invokeInvokesTheAdviceIfTheRuntimeEvaluatorReturnsTrue()
    {
        $mockJoinPoint = $this->getMockBuilder(Aop\JoinPointInterface::class)->disableOriginalConstructor()->getMock();
        $mockAspect = $this->getMockBuilder(Fixtures\SomeClass::class)->getMock();
        $mockAspect->expects($this->once())->method('someMethod')->with($mockJoinPoint);
        $mockObjectManager = $this->getMockBuilder(ObjectManagerInterface::class)->disableOriginalConstructor()->getMock();
        $mockObjectManager->expects($this->once())->method('get')->with('aspectObjectName')->will($this->returnValue($mockAspect));
        $mockDispatcher = $this->createMock(SignalSlot\Dispatcher::class);
        $advice = new Aop\Advice\AbstractAdvice('aspectObjectName', 'someMethod', $mockObjectManager, function (Aop\JoinPointInterface $joinPoint) {
            if ($joinPoint !== null) {
                return true;
            }
        });
        $this->inject($advice, 'dispatcher', $mockDispatcher);
        $advice->invoke($mockJoinPoint);
    }