public function testRenderTicket()
 {
     $tags = array(array('id' => 1, 'name' => 'Ticket Tag'));
     $renderTagResult = '<span class="tag-inline">Ticket Tag</span>';
     $this->registry->expects($this->once())->method('getRepository')->will($this->returnValue($this->sharedRepository));
     $this->tagManager->expects($this->once())->method('loadTagging')->will($this->returnValue($this->tagManager));
     $this->twig->expects($this->once())->method('render')->will($this->returnValue($renderTagResult));
     $this->sharedRepository->expects($this->once())->method('get')->will($this->returnValue($this->ticket));
     $this->ticket->expects($this->once())->method('getTags')->will($this->returnValue($this->commonCollection));
     $this->commonCollection->expects($this->once())->method('getValues')->will($this->returnValue($tags));
     $ticketResult = $this->renderTagExtensionExtension->renderTag($this->twig, 1, 'ticket');
     $this->assertEquals($renderTagResult, $ticketResult);
 }
 public function testUpdatePropertiesByKey()
 {
     $this->ticketRepository->expects($this->once())->method('get')->will($this->returnValue($this->ticket));
     $properties = array('subject' => 'DUMMY_SUBJECT_UPDT_BY_KEY', 'description' => 'DUMMY_DESC_UPDT_BY_KEY', 'status' => 'open', 'priority' => 'high', 'source' => 'phone');
     $this->ticket->expects($this->once())->method('updateProperties')->with($this->equalTo($properties));
     $this->ticket->expects($this->once())->method('getId')->will($this->returnValue(1));
     $this->ticketRepository->expects($this->once())->method('getByTicketKey')->with(new TicketKey('DT', 1))->will($this->returnValue($this->ticket));
     $this->ticketRepository->expects($this->once())->method('store')->with($this->equalTo($this->ticket));
     $this->authorizationService->expects($this->any())->method('isActionPermitted')->with($this->anything(), $this->equalTo($this->ticket))->will($this->returnValue(true));
     $command = new UpdatePropertiesCommand();
     $command->key = static::DUMMY_TICKET_KEY;
     $command->properties = $properties;
     $this->ticketService->updatePropertiesByKey($command);
 }