Example #1
0
 function it_returns_gallery_and_images_if_gallery_is_protected_and_password_is_valid(GalleryRepository $galleryRepository, ImageRepository $imageRepository)
 {
     $gallery = $this->getGallery($imageRepository->getWrappedObject(), sha1('password'));
     $galleryRepository->getBySlug('slug')->shouldBeCalled()->willReturn($gallery);
     $imageRepository->getAll()->shouldBeCalled()->willReturn(['all', 'images']);
     $this->execute()->shouldReturn(['gallery' => $gallery, 'images' => ['all', 'images']]);
 }
Example #2
0
 function it_returns_image_and_gallery(ImageRepository $imageRepository, GalleryRepository $galleryRepository)
 {
     $image = $this->getImage();
     $imageRepository->getByHash(md5('hash'))->willReturn($image);
     $gallery = $this->getGallery($imageRepository->getWrappedObject());
     $galleryRepository->getById('galleryId')->willReturn($gallery);
     $this->execute()->shouldReturn(['image' => $image, 'gallery' => $gallery]);
 }
Example #3
0
 function it_returns_all_galleries(GalleryRepository $galleryRepository)
 {
     $galleryRepository->getAll()->shouldBeCalled()->willReturn(['list', 'of', 'galleries']);
     $this->execute()->shouldReturn(['galleries' => ['list', 'of', 'galleries']]);
 }
Example #4
0
 function it_returns_gallery_by_slug(GalleryRepository $galleryRepository)
 {
     $galleryRepository->getBySlug('slug')->shouldBeCalled()->willReturn('some gallery');
     $this->execute()->shouldReturn(['gallery' => 'some gallery']);
 }