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 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'); }
/** * @param \Step\Api\User $I * @param array $params * @param int $id1 * @param int $id2 */ private function getThumbnails(\Step\Api\User $I, $params, $id1, $id2) { $I->getUserCredentialsAndUseHttpAuthentication(); $I->haveHttpHeader('Accept', 'text/event-stream'); $params['ids'] = $id1 . ';' . $id2; $I->sendGET($this->apiUrl, $params); $I->seeResponseCodeIs(200); $I->seeHttpHeader('Content-type', 'text/event-stream;charset=UTF-8'); $I->seeResponseContains('"status":200'); $I->seeResponseContains('"fileid":"' . $id1 . '","status":200'); $I->seeResponseContains('"fileid":"' . $id2 . '","status":200'); }
/** * @param \Step\Api\User $I */ private function tryToGetAValidConfig($I, $params = null) { if (!$params) { $params = $this->params; } $I->getUserCredentialsAndUseHttpAuthentication(); $I->sendGET($this->apiUrl, $params); $I->seeResponseCodeIs(200); $I->seeResponseIsJson(); }
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']); }