Exemple #1
0
 /** @Given /^the list of the existing photos:$/ */
 public function listWithTheExistingPhotos(TableNode $existing_photos)
 {
     foreach ($existing_photos as $existing_photo) {
         BooothyContext::$app['container']->get('photo.domain.repository.saver')->__invoke(new Photo(new Id($existing_photo['id']), new Quote($existing_photo['quote']), Upload::atBooothy($existing_photo['upload_filename'], $existing_photo['upload_mime_type']), new ImageDetails($existing_photo['image_hex_color'], $existing_photo['image_width'], $existing_photo['image_height']), new DateTimeImmutable($existing_photo['creation_date']), new Email($existing_photo['user_id'])));
     }
 }
 public function __invoke(Upload $upload, $generate_thumb = false)
 {
     $download_pattern_uri = $generate_thumb ? $this->booothy_thumb_download_uri : $this->booothy_download_uri;
     $download_pattern = sprintf('%s/%s', $this->booothy_url, $download_pattern_uri);
     return preg_replace('/{filename}/', $upload->filename(), $download_pattern);
 }
Exemple #3
0
 public function isStoredIn($storage_provider)
 {
     $this->upload = Upload::atBooothy($this->upload()->filename(), $this->upload()->mimeType());
 }
 private function andAnUploadValueObject()
 {
     $this->upload = Upload::AtBooothy('filename.png', 'image/png');
 }