/** * @Route("/photos/{photoId}", name="api.photo") * @Method("GET") * @return JsonResponse */ public function getPhotoAction($photoId) { $photoRepository = $this->get('freyr.gallery.repository.photo'); $photosInteractor = new GetPhotoById($photoId, $photoRepository); $response = $photosInteractor->execute(); return new JsonResponse($response); }
/** * @expectedException \Exception */ public function getNonExistingPhoto() { $interactor = new GetPhotoById(1, $this->repository); $interactor->execute(); }