/** * @param HHPnet\Core\Application\Services\Groups\GetGroup\GetGroupRequest $request */ public function it_is_not_possible_to_get_a_non_existing_group(GetGroupRequest $request) { $request->groupId()->willReturn(1); $this->repository->getById(1)->willThrow('\\UnexpectedValueException'); $this->shouldThrow('\\UnexpectedValueException')->during('execute', array($request)); }
/** * @param HHPnet\Core\Application\Services\Groups\GetGroupRequest $request * * @return HHPnet\Core\Application\Services\Groups\GetGroupResponse */ public function execute(GetGroupRequest $request) { return new GetGroupResponse($this->repository->getById($request->groupId())); }