/**
  * @param $fields
  * @param $expectedStatus
  * @param $expectedRequestResult
  *
  * @dataProvider providerTestConnection
  */
 function testConnection($fields, $expectedStatus, $expectedRequestResult)
 {
     list($httpResponseHeader, $rawResponseData) = CurlClient::postRequest(Api::ENDPOINT . '/hello', $fields);
     parse_str($rawResponseData, $decodedResponse);
     $this->assertEquals($expectedStatus, $httpResponseHeader['status']);
     $this->assertEquals($expectedRequestResult, $decodedResponse['RequestResult']);
 }
Пример #2
0
 /**
  * @param Request $request
  * @return array $httpResponseHeader, $rawResponseData, $decodeResponseData
  */
 protected function makeHttpClientCall(Request $request)
 {
     //function broken out for testing (mock this method)
     return list($httpResponseHeader, $rawResponseData) = Httpclient\CurlClient::postRequest($this->endpoint . '/' . $request->getOperation(), $request->all());
 }