Neos\Flow\Security\Authentication\Provider\TestingProvider::setName PHP Метод

setName() публичный Метод

Set the provider name
public setName ( string $name ) : void
$name string
Результат void
    public function setName($name)
    {
        $this->name = $name;
    }

Usage Example

 /**
  * Sets up security test requirements
  *
  * Security is based on action requests so we need a working route for the TestingProvider.
  *
  * @return void
  */
 protected function setupSecurity()
 {
     $this->securityContext = $this->objectManager->get(\Neos\Flow\Security\Context::class);
     if ($this->testableSecurityEnabled) {
         $this->privilegeManager = $this->objectManager->get(\Neos\Flow\Security\Authorization\TestingPrivilegeManager::class);
         $this->privilegeManager->setOverrideDecision(null);
         $this->policyService = $this->objectManager->get(\Neos\Flow\Security\Policy\PolicyService::class);
         $this->authenticationManager = $this->objectManager->get(\Neos\Flow\Security\Authentication\AuthenticationProviderManager::class);
         $this->testingProvider = $this->objectManager->get(\Neos\Flow\Security\Authentication\Provider\TestingProvider::class);
         $this->testingProvider->setName('TestingProvider');
         $this->registerRoute('functionaltestroute', 'typo3/flow/test', array('@package' => 'Neos.Flow', '@subpackage' => 'Tests\\Functional\\Mvc\\Fixtures', '@controller' => 'Standard', '@action' => 'index', '@format' => 'html'));
         $requestHandler = self::$bootstrap->getActiveRequestHandler();
         $actionRequest = $this->route($requestHandler->getHttpRequest());
         $this->securityContext->clearContext();
         $this->securityContext->setRequest($actionRequest);
     } else {
         \Neos\Utility\ObjectAccess::setProperty($this->securityContext, 'authorizationChecksDisabled', true, true);
     }
 }