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'); }
public function getPreview(\Step\Api\User $I) { $I->am('an app'); $I->wantTo('get the preview of a file'); $I->getUserCredentialsAndUseHttpAuthentication(); $data = $I->getFilesDataForFolder(''); $file = $data['animated.gif']; $url = $this->apiUrl . '/' . $file['id'] . '/1920/1080'; $I->sendGET($url); $I->downloadAFile($file, 'animated.gif'); }
/** * That's a different code path because the file is animated * * @todo maybe * * @param \Step\Api\User $I */ public function getPreviewOfAnimatedGif(\Step\Api\User $I) { $I->am('an app'); $I->wantTo('get the preview of an animated GIF file'); $I->getUserCredentialsAndUseHttpAuthentication(); $data = $I->getFilesDataForFolder(''); // 89x72 gif $file = $data['animated.gif']; $url = $this->apiUrl . '/' . $file['id'] . '/64/64'; $I->sendGET($url); $I->downloadAFile($file, 'animated.gif'); $I->checkImageSize(89, 72); }