/** * @param HHPnet\Core\Application\Services\Videos\GetVideo\GetVideoRequest $request */ public function it_is_not_possible_to_get_a_non_existing_video(GetVideoRequest $request) { $request->videoId()->willReturn(1); $this->repository->getById(1)->willThrow('\\UnexpectedValueException'); $this->shouldThrow('\\UnexpectedValueException')->during('execute', array($request)); }
/** * @param HHPnet\Core\Application\Services\Videos\GetVideo\GetVideoRequest $request * * @return HHPnet\Core\Application\Services\Videos\GetVideo\GetVideoResponse */ public function execute(GetVideoRequest $request) { return new GetVideoResponse($this->repository->getById($request->videoId())); }