25 private $notificationManagementMock;
35 private $resultFactoryMock;
40 private $jsonResultMock;
45 $this->notificationManagementMock = $this->createMock(BulkNotificationManagement::class);
46 $this->requestMock = $this->createMock(RequestInterface::class);
47 $this->resultFactoryMock = $this->createPartialMock(ResultFactory::class, [
'create']);
49 $this->jsonResultMock = $this->createMock(Json::class);
54 'notificationManagement' => $this->notificationManagementMock,
55 'request' => $this->requestMock,
56 'resultFactory' => $this->resultFactoryMock,
63 $bulkUuids = [
'49da7406-1ec3-4100-95ae-9654c83a6801'];
65 $this->requestMock->expects($this->any())
68 ->willReturn($bulkUuids);
70 $this->notificationManagementMock->expects($this->once())
71 ->method(
'acknowledgeBulks')
75 $this->resultFactoryMock->expects($this->once())
78 ->willReturn($this->jsonResultMock);
80 $this->assertEquals($this->jsonResultMock, $this->model->execute());
85 $bulkUuids = [
'49da7406-1ec3-4100-95ae-9654c83a6801'];
87 $this->requestMock->expects($this->any())
90 ->willReturn($bulkUuids);
92 $this->resultFactoryMock->expects($this->once())
95 ->willReturn($this->jsonResultMock);
97 $this->notificationManagementMock->expects($this->once())
98 ->method(
'acknowledgeBulks')
102 $this->jsonResultMock->expects($this->once())
103 ->method(
'setHttpResponseCode')
106 $this->assertEquals($this->jsonResultMock, $this->model->execute());
testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedCorrectly()