/**
  * @covers Intacct\Xml\RequestHandler::getVerifySSL
  */
 public function testGetVerifySSL()
 {
     $config = ['control_id' => 'unittest', 'sender_id' => 'testsenderid', 'sender_password' => 'pass123!', 'session_id' => 'testsession..', 'verify_ssl' => false];
     $contentBlock = new Content();
     $requestBlock = new RequestBlock($config, $contentBlock);
     $requestHandler = new RequestHandler($config, $requestBlock);
     $this->assertEquals($requestHandler->getVerifySSL(), false);
 }
Exemplo n.º 2
0
 /**
  * Get API session array
  *
  * @param array $config
  * @return array
  */
 private function getAPISession(array $config)
 {
     $contentBlock = new Content();
     $getApiSession = new ApiSessionCreate();
     $contentBlock->append($getApiSession);
     $requestHandler = new RequestHandler($config);
     $response = $requestHandler->executeSynchronous($config, $contentBlock);
     $operation = $response->getOperation();
     $authentication = $operation->getAuthentication();
     $result = $operation->getResult(0);
     $data = $result->getData();
     $api = $data->api;
     $session = ['session_id' => strval($api->sessionid), 'endpoint_url' => strval($api->endpoint), 'verify_ssl' => $requestHandler->getVerifySSL(), 'current_company_id' => $authentication->getCompanyId(), 'current_user_id' => $authentication->getUserId(), 'current_user_is_external' => $authentication->getSlideInUser()];
     return $session;
 }