public function connectToPreview(\Step\Api\TokenUser $I)
 {
     $I->am('a guest with a token');
     $I->wantTo('make sure I can get the preview');
     $data = $I->getFilesDataForFolder('shared1');
     $file = $data['testimage.gif'];
     $url = GalleryApp::$URL . '/preview.public/' . $file['id'];
     $params = ['width' => 800, 'height' => 600];
     $this->connect($I, $url, $params, $this->browserHeader);
     $I->downloadAFile($file, 'testimage.gif');
 }
 /**
  * This is a special case to make sure we get a 404 in case of a missing token on the public
  * download page
  *
  * @param \Step\Api\TokenUser $I
  */
 public function TryTodownloadFileWithoutAToken(\Step\Api\TokenUser $I)
 {
     $I->am('a thief');
     $I->wantTo('steal all the files I can get my hands on');
     $fileMetaData = $I->getSharedFileInformation();
     $params = ['fileId' => $fileMetaData['fileId']];
     $I->haveHttpHeader('Accept', $this->browserHeader);
     $I->sendGET(GalleryApp::$URL . '/files.public/download/{fileId}', $params);
     $I->seeResponseCodeIs(404);
     $I->seeHttpHeader('Content-type', 'text/html; charset=UTF-8');
 }