public function testLoadTicketByKey() { $key = 'TK-1'; $ticket = $this->ticket; $this->authorizationService->expects($this->once())->method('isActionPermitted')->with('VIEW', $ticket)->will($this->returnValue(true)); $this->ticketRepository->expects($this->once())->method('getByTicketKey')->with(new TicketKey('TK', 1))->will($this->returnValue($ticket)); $this->ticketService->loadTicketByKey($key); }
/** * Load Ticket by given Ticket Key * * @ApiDoc( * description="Returns a ticket by ticket key", * uri="/tickets/{key}.{_format}", * method="GET", * resource=true, * requirements={ * { * "name"="key", * "dataType"="string", * "requirement"="^.*-[0-9]+$", * "description"="Ticket Key" * } * }, * statusCodes={ * 200="Returned when successful", * 403="Returned when the user is not authorized to see ticket", * 404="Returned when the ticket is not found" * } * ) * * @param string $key * @return \Diamante\DeskBundle\Model\Ticket\Ticket */ public function loadTicketByKey($key) { return parent::loadTicketByKey($key); }