/**
  * @param \Step\Api\User $I
  */
 public function getFolderThumbnails(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('get the thumbnails for the albums in this folder');
     $params = $this->params;
     $params['square'] = true;
     $data = $I->getFilesDataForFolder('folder1');
     $id1 = $data['testimage.jpg']['id'];
     $id2 = $data['testimage-wide.png']['id'];
     $this->getThumbnails($I, $params, $id1, $id2);
 }
Example #2
0
 public function downloadFile(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('download a file');
     $I->getUserCredentialsAndUseHttpAuthentication();
     $data = $I->getFilesDataForFolder('');
     $file = $data['testimage.jpg'];
     $url = $this->apiUrl . '/' . $file['id'];
     $I->sendGET($url);
     $I->downloadAFile($file, 'testimage.jpg');
 }
Example #3
0
 public function getPreviewOfBrokenFile(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('get the preview of a broken file');
     $I->expect('an 500 status and an error message');
     $I->getUserCredentialsAndUseHttpAuthentication();
     $data = $I->getFilesDataForFolder('');
     $file = $data['testimage-corrupt.jpg'];
     $url = $this->apiUrl . '/' . $file['id'] . '/1920/1080';
     $I->sendGET($url);
     $I->seeResponseCodeIs(500);
     $I->seeResponseContainsJson(['success' => false]);
 }
 public function getThumbnailOfBrokenFile(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('receive an event with a 500 code when trying to get the thumbnail of a broken file');
     $I->getUserCredentialsAndUseHttpAuthentication();
     $I->haveHttpHeader('Accept', 'text/event-stream');
     $data = $I->getFilesDataForFolder('');
     $id = $data['testimage-corrupt.jpg']['id'];
     $this->params['ids'] = $id;
     $I->sendGET($this->apiUrl, $this->params);
     $I->seeResponseCodeIs(200);
     $I->seeHttpHeader('Content-type', 'text/event-stream;charset=UTF-8');
     $I->seeResponseContains('"fileid":"' . $id . '","status":500');
 }