/** * @test */ public function thatRetrievesBranchById() { $branch = new Branch('DN', 'DUMMY_NAME', 'DUMMY_DESC'); $this->branchRepository->expects($this->once())->method('get')->with($this->equalTo(self::DUMMY_BRANCH_ID))->will($this->returnValue($branch)); $this->authorizationService->expects($this->once())->method('isActionPermitted')->with($this->equalTo('VIEW'), $this->equalTo('Entity:DiamanteDeskBundle:Branch'))->will($this->returnValue(true)); $retrievedBranch = $this->branchServiceImpl->getBranch(self::DUMMY_BRANCH_ID); $this->assertEquals($branch, $retrievedBranch); }
/** * Retrieves Branch by id * * @ApiDoc( * description="Returns a branch", * uri="/branches/{id}.{_format}", * method="GET", * resource=true, * requirements={ * { * "name"="id", * "dataType"="integer", * "requirement"="\d+", * "description"="Branch Id" * } * }, * statusCodes={ * 200="Returned when successful", * 403="Returned when the user is not authorized to see branch", * 404="Returned when the branch is not found" * } * ) * * @param $id * @return \Diamante\DeskBundle\Model\Branch\Branch */ public function getBranch($id) { return parent::getBranch($id); }