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']]); }
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]); }