Returns runtime evaluations for the pointcut.
public getRuntimeEvaluationsDefinition ( ) : array | ||
return | array | Runtime evaluations |
/** * Returns runtime evaluations for the pointcut. * * @return array Runtime evaluations */ public function getRuntimeEvaluationsDefinition() { if ($this->pointcut === null) { $this->pointcut = $this->proxyClassBuilder->findPointcut($this->aspectClassName, $this->pointcutMethodName); } if ($this->pointcut === false) { return []; } return $this->pointcut->getRuntimeEvaluationsDefinition(); }
/** * @test */ public function getRuntimeEvaluationsReturnsTheRuntimeEvaluationsDefinitionOfTheContainedPointcutFilterComposite() { $pointcutExpression = 'ThePointcutExpression'; $aspectClassName = 'TheAspect'; $className = 'TheClass'; $mockPointcutFilterComposite = $this->getMockBuilder(Pointcut\PointcutFilterComposite::class)->disableOriginalConstructor()->getMock(); $mockPointcutFilterComposite->expects($this->once())->method('getRuntimeEvaluationsDefinition')->will($this->returnValue(['runtimeEvaluationsDefinition'])); $pointcut = new Pointcut\Pointcut($pointcutExpression, $mockPointcutFilterComposite, $aspectClassName, $className); $this->assertEquals(['runtimeEvaluationsDefinition'], $pointcut->getRuntimeEvaluationsDefinition(), 'The runtime evaluations definition has not been returned as expected.'); }