public function testRenderBranch()
 {
     $tags = array(array('id' => 1, 'name' => 'Branch Tag'));
     $renderTagResult = '<span class="tag-inline">Branch 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->branch));
     $this->branch->expects($this->once())->method('getTags')->will($this->returnValue($this->commonCollection));
     $this->commonCollection->expects($this->once())->method('getValues')->will($this->returnValue($tags));
     $branchResult = $this->renderTagExtensionExtension->renderTag($this->twig, 1, 'branch');
     $this->assertEquals($renderTagResult, $branchResult);
 }
 public function testProcessWhenMessageWithoutReferenceWithoutDefaultBranch()
 {
     $message = new Message(self::DUMMY_UNIQUE_ID, self::DUMMY_MESSAGE_ID, self::DUMMY_SUBJECT, self::DUMMY_CONTENT, $this->getDummyFrom(), self::DUMMY_MESSAGE_TO);
     $assigneeId = 1;
     $diamanteUser = $this->getReporter(1);
     $this->userService->expects($this->once())->method('getUserByEmail')->with($this->equalTo(self::DUMMY_MESSAGE_FROM))->will($this->returnValue($diamanteUser));
     $this->configManager->expects($this->once())->method('get')->with($this->equalTo('diamante_desk.default_branch'))->will($this->returnValue(1));
     $this->branchService->expects($this->once())->method('getBranch')->with($this->equalTo(1))->will($this->returnValue($this->defaultBranch));
     $this->defaultBranch->expects($this->any())->method('getDefaultAssigneeId')->will($this->returnValue($assigneeId));
     $reporter = $this->getReporter($diamanteUser->getId());
     $this->messageReferenceService->expects($this->once())->method('createTicket')->with($this->equalTo($message->getMessageId()), self::DUMMY_BRANCH_ID, $message->getSubject(), $message->getContent(), $reporter, $assigneeId);
     $this->ticketStrategy->process($message);
 }