/**
  * Tests the building of the remote upload status
  */
 public function testBuildRemoteUploadStatus()
 {
     $data = json_decode($this->fixtureStatus, true);
     $status = RemoteUploadBuilder::buildRemoteUploadStatus($data);
     $this->assertInstanceOf('Ideneal\\OpenLoad\\Entity\\RemoteUploadStatus', $status);
 }
Example #2
0
 /**
  * Returns the latest remote upload statuses
  *
  * @param int $limit The maximum number of result (maximum 100)
  *
  * @return RemoteUploadStatus[]
  */
 public function getLatestRemoteUploadStatuses($limit = 5)
 {
     $params = $this->getAuthParams();
     $params['limit'] = max([0, min([$limit, 100])]);
     $response = $this->processRequest('remotedl/status', $params);
     $results = $this->processResponse($response);
     $status = [];
     foreach ($results as $result) {
         $status[] = RemoteUploadBuilder::buildRemoteUploadStatus($result);
     }
     return $status;
 }