public function testBuildingSucceedsIfWriteSideHandlerExistsAndImplementsInterface()
 {
     $uriComponents = $this->getUriComponentsMock('domain', 'valid-write-test', []);
     $domainRequestHandlerBuilder = new DomainRequestHandlerBuilder('Fortuneglobe\\IceHawk\\Tests\\Unit\\Fixtures', Http::METHOD_POST, $uriComponents);
     $request = new PostRequest(RequestInfo::fromEnv(), [], []);
     $handler = $domainRequestHandlerBuilder->buildDomainRequestHandler($request);
     $this->assertInstanceOf(ValidWriteTestRequestHandler::class, $handler);
 }
Example #2
0
 /**
  * @param ServesUriComponents $uriComponents
  * @param ServesRequestData   $request
  *
  * @return HandlesDomainRequests
  */
 private function getDomainRequestHandler(ServesUriComponents $uriComponents, ServesRequestData $request)
 {
     $domainNamespace = $this->config->getDomainNamespace();
     $requestInfo = $this->config->getRequestInfo();
     $builder = new DomainRequestHandlerBuilder($domainNamespace, $requestInfo->getMethod(), $uriComponents);
     $domainRequestHandler = $builder->buildDomainRequestHandler($request);
     return $domainRequestHandler;
 }
Example #3
0
 /**
  * @param ServesUriComponents $uriComponents
  * @param ServesRequestData   $request
  *
  * @return HandlesDomainRequests
  */
 private function getDomainRequestHandler(ServesUriComponents $uriComponents, ServesRequestData $request)
 {
     $domainRequestHandlerBuilder = new DomainRequestHandlerBuilder($this->domainNamespace, $this->requestInfo->getMethod(), $uriComponents);
     return $domainRequestHandlerBuilder->buildDomainRequestHandler($request);
 }