/**
  *
  * @param string $requestMethod
  * @param array  $getData
  * @param array  $postData
  * @param array  $params
  * @param array  $expectedData
  *
  * @throws \Fortuneglobe\IceHawk\Exceptions\InvalidRequestMethod
  * @dataProvider uriComponentsParamsOverrideProvider
  */
 public function testUriComponentsParamsOverrideRequestParams($requestMethod, array $getData, array $postData, array $params, array $expectedData)
 {
     $requestInfo = new RequestInfo(['REQUEST_METHOD' => $requestMethod]);
     $uriComponents = new UriComponents('Unit', 'Test', $params);
     $requestBuilder = new RequestBuilder($requestInfo, $uriComponents);
     $request = $requestBuilder->buildRequest($getData, $postData, []);
     $this->assertSame($expectedData, $request->getData());
 }
Esempio n. 2
0
 /**
  * @param ServesUriComponents $uriComponents
  *
  * @throws Exceptions\InvalidRequestMethod
  * @return Interfaces\ServesGetRequestData|Interfaces\ServesPostRequestData
  */
 private function getRequest(ServesUriComponents $uriComponents)
 {
     $requestInfo = $this->config->getRequestInfo();
     $builder = new RequestBuilder($requestInfo, $uriComponents);
     $request = $builder->buildRequest($_GET, $_POST, $_FILES);
     return $request;
 }
Esempio n. 3
0
 /**
  * @param ServesUriComponents $uriComponents
  *
  * @throws Exceptions\InvalidRequestMethod
  * @return Interfaces\ServesGetRequestData|Interfaces\ServesPostRequestData
  */
 private function getRequest(ServesUriComponents $uriComponents)
 {
     $requestBuilder = new RequestBuilder($this->requestInfo, $uriComponents);
     return $requestBuilder->buildRequest($_GET, $_POST, $_FILES);
 }