Fix tests

remotes/upstream/api-rewrite
Mike Koch 7 years ago
parent cc880a15fc
commit f40eaf1a23

@ -66,7 +66,7 @@ class AutoassignerTest extends TestCase {
$userWithOneOpenTicket $userWithOneOpenTicket
); );
$this->userGateway->method('getUsersByNumberOfOpenTickets') $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign')
->with($this->heskSettings) ->with($this->heskSettings)
->willReturn($usersToReturn); ->willReturn($usersToReturn);
@ -92,7 +92,7 @@ class AutoassignerTest extends TestCase {
$userWithOneOpenTicket $userWithOneOpenTicket
); );
$this->userGateway->method('getUsersByNumberOfOpenTickets') $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign')
->with($this->heskSettings) ->with($this->heskSettings)
->willReturn($usersToReturn); ->willReturn($usersToReturn);
@ -119,7 +119,7 @@ class AutoassignerTest extends TestCase {
$userWithOneOpenTicket $userWithOneOpenTicket
); );
$this->userGateway->method('getUsersByNumberOfOpenTickets') $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign')
->with($this->heskSettings) ->with($this->heskSettings)
->willReturn($usersToReturn); ->willReturn($usersToReturn);
@ -145,7 +145,7 @@ class AutoassignerTest extends TestCase {
$userWithOneOpenTicket $userWithOneOpenTicket
); );
$this->userGateway->method('getUsersByNumberOfOpenTickets') $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign')
->with($this->heskSettings) ->with($this->heskSettings)
->willReturn($usersToReturn); ->willReturn($usersToReturn);
@ -171,7 +171,7 @@ class AutoassignerTest extends TestCase {
$userWithOneOpenTicket $userWithOneOpenTicket
); );
$this->userGateway->method('getUsersByNumberOfOpenTickets') $this->userGateway->method('getUsersByNumberOfOpenTicketsForAutoassign')
->with($this->heskSettings) ->with($this->heskSettings)
->willReturn($usersToReturn); ->willReturn($usersToReturn);

@ -7,6 +7,7 @@ use BusinessLogic\Emails\Addressees;
use BusinessLogic\Emails\EmailSenderHelper; use BusinessLogic\Emails\EmailSenderHelper;
use BusinessLogic\Emails\EmailTemplateRetriever; use BusinessLogic\Emails\EmailTemplateRetriever;
use BusinessLogic\Security\UserContext; use BusinessLogic\Security\UserContext;
use BusinessLogic\Security\UserContextNotifications;
use BusinessLogic\Statuses\Status; use BusinessLogic\Statuses\Status;
use BusinessLogic\Tickets\Autoassigner; use BusinessLogic\Tickets\Autoassigner;
use BusinessLogic\Tickets\CreateTicketByCustomerModel; use BusinessLogic\Tickets\CreateTicketByCustomerModel;
@ -136,6 +137,7 @@ class CreateTicketTest extends TestCase {
$this->trackingIdGenerator->method('generateTrackingId')->willReturn('123-456-7890'); $this->trackingIdGenerator->method('generateTrackingId')->willReturn('123-456-7890');
$this->ticketGatewayGeneratedFields = new TicketGatewayGeneratedFields(); $this->ticketGatewayGeneratedFields = new TicketGatewayGeneratedFields();
$this->ticketGateway->method('createTicket')->willReturn($this->ticketGatewayGeneratedFields); $this->ticketGateway->method('createTicket')->willReturn($this->ticketGatewayGeneratedFields);
$this->userGateway->method('getUsersForNewTicketNotification')->willReturn(array());
$status = new Status(); $status = new Status();
$status->id = 1; $status->id = 1;
@ -169,8 +171,12 @@ class CreateTicketTest extends TestCase {
//-- Arrange //-- Arrange
$this->heskSettings['autoassign'] = 1; $this->heskSettings['autoassign'] = 1;
$autoassignUser = new UserContext(); $autoassignUser = new UserContext();
$notificationSettings = new UserContextNotifications();
$notificationSettings->newAssignedToMe = true;
$autoassignUser->notificationSettings = $notificationSettings;
$autoassignUser->id = 1; $autoassignUser->id = 1;
$this->autoassigner->method('getNextUserForTicket')->willReturn($autoassignUser); $this->autoassigner->method('getNextUserForTicket')->willReturn($autoassignUser);
$this->userGateway->method('getUserById')->willReturn($autoassignUser);
$this->modsForHeskSettingsGateway->method('getAllSettings')->willReturn($this->modsForHeskSettings); $this->modsForHeskSettingsGateway->method('getAllSettings')->willReturn($this->modsForHeskSettings);
//-- Act //-- Act

Loading…
Cancel
Save