/**
  * @test
  */
 public function invokeCallsTheAccessDecisionManagerToDecideOnTheCurrentJoinPoint()
 {
     $authenticationManager = $this->getMock('TYPO3\\Flow\\Security\\Authentication\\AuthenticationManagerInterface');
     $accessDecisionManager = $this->getMock('TYPO3\\Flow\\Security\\Authorization\\AccessDecisionManagerInterface');
     $joinPoint = $this->getMock('TYPO3\\Flow\\Aop\\JoinPointInterface');
     $accessDecisionManager->expects($this->once())->method('decideOnJoinPoint')->with($joinPoint);
     $interceptor = new \TYPO3\Flow\Security\Authorization\Interceptor\PolicyEnforcement($authenticationManager, $accessDecisionManager);
     $interceptor->setJoinPoint($joinPoint);
     $interceptor->invoke();
 }
 /**
  * @test
  */
 public function invokeCallsThePrivilegeManagerToDecideOnTheCurrentJoinPoint()
 {
     $securityContext = $this->createMock(\TYPO3\Flow\Security\Context::class);
     $authenticationManager = $this->createMock(\TYPO3\Flow\Security\Authentication\AuthenticationManagerInterface::class);
     $privilegeManager = $this->createMock(\TYPO3\Flow\Security\Authorization\PrivilegeManagerInterface::class);
     $joinPoint = $this->createMock(\TYPO3\Flow\Aop\JoinPointInterface::class);
     $privilegeManager->expects($this->once())->method('isGranted')->with(\TYPO3\Flow\Security\Authorization\Privilege\Method\MethodPrivilegeInterface::class);
     $interceptor = new \TYPO3\Flow\Security\Authorization\Interceptor\PolicyEnforcement($securityContext, $authenticationManager, $privilegeManager);
     $interceptor->setJoinPoint($joinPoint);
     $interceptor->invoke();
 }