Neos\Flow\Validation\ValidatorResolver::reset PHP 메소드

reset() 공개 메소드

Resets the baseValidatorConjunctions It is usually not required to reset the ValidatorResolver during one request. This method is mainly useful for functional tests
public reset ( ) : void
리턴 void
    public function reset()
    {
        $this->baseValidatorConjunctions = [];
    }

Usage Example

 /**
  * Sends the given HTTP request
  *
  * @param Http\Request $httpRequest
  * @return Http\Response
  * @throws Http\Exception
  * @api
  */
 public function sendRequest(Http\Request $httpRequest)
 {
     $requestHandler = $this->bootstrap->getActiveRequestHandler();
     if (!$requestHandler instanceof FunctionalTestRequestHandler) {
         throw new Http\Exception('The browser\'s internal request engine has only been designed for use within functional tests.', 1335523749);
     }
     $this->securityContext->clearContext();
     $this->validatorResolver->reset();
     $response = new Http\Response();
     $componentContext = new ComponentContext($httpRequest, $response);
     $requestHandler->setComponentContext($componentContext);
     $objectManager = $this->bootstrap->getObjectManager();
     $baseComponentChain = $objectManager->get(\Neos\Flow\Http\Component\ComponentChain::class);
     $componentContext = new ComponentContext($httpRequest, $response);
     try {
         $baseComponentChain->handle($componentContext);
     } catch (\Throwable $throwable) {
         $this->prepareErrorResponse($throwable, $componentContext->getHttpResponse());
     } catch (\Exception $exception) {
         $this->prepareErrorResponse($exception, $componentContext->getHttpResponse());
     }
     $session = $this->bootstrap->getObjectManager()->get(SessionInterface::class);
     if ($session->isStarted()) {
         $session->close();
     }
     $this->persistenceManager->clearState();
     return $componentContext->getHttpResponse();
 }