public function invokeDoesNotInvokeTheAdviceIfTheRuntimeEvaluatorReturnsFalse()
{
$mockJoinPoint = $this->getMockBuilder(Aop\JoinPointInterface::class)->disableOriginalConstructor()->getMock();
$mockAspect = $this->createMock(Fixtures\SomeClass::class);
$mockAspect->expects($this->never())->method('someMethod');
$mockObjectManager = $this->getMockBuilder(ObjectManagerInterface::class)->disableOriginalConstructor()->getMock();
$mockObjectManager->expects($this->any())->method('get')->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 false;
}
});
$this->inject($advice, 'dispatcher', $mockDispatcher);
$advice->invoke($mockJoinPoint);
}