diff --git a/api/Tests/BusinessLogic/Tickets/AutoassignerTest.php b/api/Tests/BusinessLogic/Tickets/AutoassignerTest.php index 1962395b..8e9836ac 100644 --- a/api/Tests/BusinessLogic/Tickets/AutoassignerTest.php +++ b/api/Tests/BusinessLogic/Tickets/AutoassignerTest.php @@ -66,7 +66,7 @@ class AutoassignerTest extends TestCase { $userWithOneOpenTicket ); - $this->userGateway->method('getUsersByNumberOfOpenTickets') + $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign') ->with($this->heskSettings) ->willReturn($usersToReturn); @@ -92,7 +92,7 @@ class AutoassignerTest extends TestCase { $userWithOneOpenTicket ); - $this->userGateway->method('getUsersByNumberOfOpenTickets') + $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign') ->with($this->heskSettings) ->willReturn($usersToReturn); @@ -119,7 +119,7 @@ class AutoassignerTest extends TestCase { $userWithOneOpenTicket ); - $this->userGateway->method('getUsersByNumberOfOpenTickets') + $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign') ->with($this->heskSettings) ->willReturn($usersToReturn); @@ -145,7 +145,7 @@ class AutoassignerTest extends TestCase { $userWithOneOpenTicket ); - $this->userGateway->method('getUsersByNumberOfOpenTickets') + $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign') ->with($this->heskSettings) ->willReturn($usersToReturn); @@ -171,7 +171,7 @@ class AutoassignerTest extends TestCase { $userWithOneOpenTicket ); - $this->userGateway->method('getUsersByNumberOfOpenTickets') + $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign') ->with($this->heskSettings) ->willReturn($usersToReturn); diff --git a/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php b/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php index 5f8383e0..29b88a2b 100644 --- a/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php +++ b/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php @@ -7,6 +7,7 @@ use BusinessLogic\Emails\Addressees; use BusinessLogic\Emails\EmailSenderHelper; use BusinessLogic\Emails\EmailTemplateRetriever; use BusinessLogic\Security\UserContext; +use BusinessLogic\Security\UserContextNotifications; use BusinessLogic\Statuses\Status; use BusinessLogic\Tickets\Autoassigner; use BusinessLogic\Tickets\CreateTicketByCustomerModel; @@ -136,6 +137,7 @@ class CreateTicketTest extends TestCase { $this->trackingIdGenerator->method('generateTrackingId')->willReturn('123-456-7890'); $this->ticketGatewayGeneratedFields = new TicketGatewayGeneratedFields(); $this->ticketGateway->method('createTicket')->willReturn($this->ticketGatewayGeneratedFields); + $this->userGateway->method('getUsersForNewTicketNotification')->willReturn(array()); $status = new Status(); $status->id = 1; @@ -169,8 +171,12 @@ class CreateTicketTest extends TestCase { //-- Arrange $this->heskSettings['autoassign'] = 1; $autoassignUser = new UserContext(); + $notificationSettings = new UserContextNotifications(); + $notificationSettings->newAssignedToMe = true; + $autoassignUser->notificationSettings = $notificationSettings; $autoassignUser->id = 1; $this->autoassigner->method('getNextUserForTicket')->willReturn($autoassignUser); + $this->userGateway->method('getUserById')->willReturn($autoassignUser); $this->modsForHeskSettingsGateway->method('getAllSettings')->willReturn($this->modsForHeskSettings); //-- Act