public function testGetFileUploadStatus()
 {
     $response = self::$client->get('/');
     $statuses = array();
     foreach ($response->json() as $result) {
         $statuses[] = FileUploadStatus::create($result);
     }
     $fileUploadStatus = $statuses[0];
     $this->assertEquals("9", $fileUploadStatus->file_id);
     $this->assertEquals("Active", $fileUploadStatus->description);
     $this->assertEquals("Active", $fileUploadStatus->status);
 }
Esempio n. 2
0
 /**
  * Get the status of a File upload
  * @param string $accessToken - Constant Contact OAuth2 token
  * @param string $uploadStatusIds - Single ID or ID's of statuses to check, separated by commas (no spaces)
  * @return FileUploadStatus[] - Array of FileUploadStatus
  * @throws CtctException
  */
 public function getFileUploadStatus($accessToken, $uploadStatusIds)
 {
     $baseUrl = Config::get('endpoints.base_url') . sprintf(Config::get('endpoints.library_file_upload_status'), $uploadStatusIds);
     $request = parent::createBaseRequest($accessToken, "GET", $baseUrl);
     try {
         $response = parent::getClient()->send($request);
     } catch (ClientException $e) {
         throw parent::convertException($e);
     }
     $fileUploadStatuses = array();
     foreach ($response->json() as $fileUploadStatus) {
         $fileUploadStatuses[] = FileUploadStatus::create($fileUploadStatus);
     }
     return $fileUploadStatuses;
 }