From 3485a5b7dbeec7c0051b93a579ae4e5cfb61d279 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 26 Sep 2017 21:19:17 -0400 Subject: [PATCH] Fix tests --- .../CreateTicketForCustomerTest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php b/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php index c2577ab0..69d817d6 100644 --- a/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php +++ b/api/Tests/BusinessLogic/Tickets/TicketCreatorTests/CreateTicketForCustomerTest.php @@ -18,6 +18,7 @@ use BusinessLogic\Tickets\TrackingIdGenerator; use BusinessLogic\Tickets\VerifiedEmailChecker; use BusinessLogic\ValidationModel; use Core\Constants\Priority; +use DataAccess\AuditTrail\AuditTrailGateway; use DataAccess\Security\UserGateway; use DataAccess\Settings\ModsForHeskSettingsGateway; use DataAccess\Statuses\StatusGateway; @@ -97,6 +98,9 @@ class CreateTicketTest extends TestCase { /* @var $modsForHeskSettings array */ private $modsForHeskSettings; + /* @var $auditTrailGateway \PHPUnit_Framework_MockObject_MockObject|AuditTrailGateway */ + private $auditTrailGateway; + protected function setUp() { $this->ticketGateway = $this->createMock(TicketGateway::clazz()); $this->newTicketValidator = $this->createMock(NewTicketValidator::clazz()); @@ -107,10 +111,11 @@ class CreateTicketTest extends TestCase { $this->emailSenderHelper = $this->createMock(EmailSenderHelper::clazz()); $this->userGateway = $this->createMock(UserGateway::clazz()); $this->modsForHeskSettingsGateway = $this->createMock(ModsForHeskSettingsGateway::clazz()); + $this->auditTrailGateway = $this->createMock(AuditTrailGateway::clazz()); $this->ticketCreator = new TicketCreator($this->newTicketValidator, $this->trackingIdGenerator, $this->autoassigner, $this->statusGateway, $this->ticketGateway, $this->verifiedEmailChecker, - $this->emailSenderHelper, $this->userGateway, $this->modsForHeskSettingsGateway); + $this->emailSenderHelper, $this->userGateway, $this->modsForHeskSettingsGateway, $this->auditTrailGateway); $this->ticketRequest = new CreateTicketByCustomerModel(); $this->ticketRequest->name = 'Name'; @@ -126,7 +131,8 @@ class CreateTicketTest extends TestCase { 'require_subject' => 1, 'require_message' => 1, 'custom_fields' => array(), - 'autoassign' => 0 + 'autoassign' => 0, + 'timeformat' => 'Y-m-d', ); $this->modsForHeskSettings = array( 'customer_email_verification_required' => false @@ -222,7 +228,7 @@ class CreateTicketTest extends TestCase { //-- Assert self::assertThat($ticket->ticket->name, self::equalTo($this->ticketRequest->name)); - self::assertThat($ticket->ticket->email, self::equalTo($this->ticketRequest->email)); + self::assertThat($ticket->ticket->email[0], self::equalTo($this->ticketRequest->email)); self::assertThat($ticket->ticket->priorityId, self::equalTo($this->ticketRequest->priority)); self::assertThat($ticket->ticket->categoryId, self::equalTo($this->ticketRequest->category)); self::assertThat($ticket->ticket->subject, self::equalTo($this->ticketRequest->subject));