public function testUpdateProperties() { $this->ticketRepository->expects($this->once())->method('get')->will($this->returnValue($this->ticket)); $properties = array('subject' => 'DUMMY_SUBJECT_UPDT', 'description' => 'DUMMY_DESC_UPDT', 'status' => 'open', 'priority' => 'high', 'source' => 'phone'); $this->ticket->expects($this->once())->method('updateProperties')->with($this->equalTo($properties)); $this->ticketRepository->expects($this->once())->method('store')->with($this->equalTo($this->ticket)); $this->authorizationService->expects($this->once())->method('isActionPermitted')->with($this->equalTo('EDIT'), $this->equalTo($this->ticket))->will($this->returnValue(true)); $command = new UpdatePropertiesCommand(); $command->id = 1; $command->properties = $properties; $this->ticketService->updateProperties($command); }
/** * Update certain properties of the Ticket * * @ApiDoc( * description="Update ticket", * uri="/tickets/{id}.{_format}", * method={ * "PUT", * "PATCH" * }, * resource=true, * requirements={ * { * "name"="id", * "dataType"="integer", * "requirement"="\d+", * "description"="Ticket Id" * } * }, * statusCodes={ * 200="Returned when successful", * 403="Returned when the user is not authorized to update ticket", * 404="Returned when the ticket is not found" * } * ) * * @param Command\UpdatePropertiesCommand $command * @return \Diamante\DeskBundle\Model\Ticket\Ticket */ public function updateProperties(Command\UpdatePropertiesCommand $command) { return parent::updateProperties($command); }