Example #1
0
 public function fileNotFoundPage(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('download a file without a valid fileId');
     $I->amGoingTo("send a fileId which doesn't exist");
     $I->expectTo("be redirected to an error 404 page");
     $I->getUserCredentialsAndUseHttpAuthentication();
     $url = $this->apiUrl . '/9999999';
     $I->sendGET($url);
     $I->seeResponseCodeIs(404);
     $I->seeHttpHeader('Content-type', 'text/html; charset=UTF-8');
 }
 public function getFileNotFoundCode(\Step\Api\User $I)
 {
     $I->am('an app');
     $I->wantTo('receive 404 events when I send the wrong IDs');
     $I->getUserCredentialsAndUseHttpAuthentication();
     $I->haveHttpHeader('Accept', 'text/event-stream');
     $this->params['ids'] = '99998;99999';
     $I->sendGET($this->apiUrl, $this->params);
     $I->seeResponseCodeIs(200);
     $I->seeHttpHeader('Content-type', 'text/event-stream;charset=UTF-8');
     $I->seeResponseContains('"fileid":"99998","status":404');
     $I->seeResponseContains('"fileid":"99999","status":404');
 }
 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');
 }
Example #5
0
 /**
  * @depends getConfig
  *
  * @param \Step\Api\User $I
  */
 public function getEmptyConfig(\Step\Api\User $I)
 {
     $I->emptyMyConfigFile();
     $I->am('an app');
     $I->wantTo('get the current Gallery configuration');
     $I->expectTo('see empty features');
     $this->tryToGetAValidConfig($I);
     $I->seeResponseContainsJson(['features' => []]);
     $I->seeResponseContainsJson($this->mediaTypes);
     $I->fixMyConfigFile();
 }
Example #6
0
 public function getListOfForbiddenPath(\Step\Api\User $I)
 {
     $params = $this->params;
     // This folder contains a .nomedia file
     $params['location'] = 'folder4';
     $I->am('an app');
     $I->wantTo('get the list of files of a folder which contains the .nomedia file');
     $I->getUserCredentialsAndUseHttpAuthentication();
     $I->sendGET($this->apiUrl, $params);
     $I->seeResponseCodeIs(403);
     $I->seeResponseIsJson();
     $I->seeResponseContainsJson(['message' => 'Album is private or unavailable']);
 }