/** * @expectedException \RuntimeException */ public function testAssignTicketWhenAssigneeDoesNotExist() { $currentUserId = 2; $assigneeId = 3; $this->ticketRepository->expects($this->once())->method('get')->with($this->equalTo(self::DUMMY_TICKET_ID))->will($this->returnValue($this->ticket)); $this->authorizationService->expects($this->any())->method('getLoggedUserId')->will($this->returnValue($currentUserId)); $this->authorizationService->expects($this->once())->method('isActionPermitted')->with($this->equalTo('EDIT'), $this->equalTo($this->ticket))->will($this->returnValue(true)); $command = new AssigneeTicketCommand(); $command->id = self::DUMMY_TICKET_ID; $command->assignee = $assigneeId; $this->ticketService->assignTicket($command); }