Skip to content

Commit fb586ea

Browse files
committed
Merge remote-tracking branch 'magento-l3/ACP2E-1245-V2' into ACP2E-1405
2 parents ffaaaaf + b24f727 commit fb586ea

File tree

2 files changed

+14
-3
lines changed
  • app/code/Magento/AsynchronousOperations

2 files changed

+14
-3
lines changed

app/code/Magento/AsynchronousOperations/Controller/Adminhtml/Notification/Dismiss.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
use Magento\AsynchronousOperations\Model\BulkNotificationManagement;
99
use Magento\Backend\App\Action\Context;
1010
use Magento\Backend\App\Action;
11+
use Magento\Framework\App\Action\HttpPostActionInterface;
1112
use Magento\Framework\Controller\ResultFactory;
1213

1314
/**
1415
* Class Bulk Notification Dismiss Controller
1516
*/
16-
class Dismiss extends Action
17+
class Dismiss extends Action implements HttpPostActionInterface
1718
{
1819
/**
1920
* @var BulkNotificationManagement
@@ -43,7 +44,7 @@ protected function _isAllowed()
4344
}
4445

4546
/**
46-
* {@inheritdoc}
47+
* @inheritdoc
4748
*/
4849
public function execute()
4950
{
@@ -55,7 +56,7 @@ public function execute()
5556
$isAcknowledged = $this->notificationManagement->acknowledgeBulks($bulkUuids);
5657

5758
/** @var \Magento\Framework\Controller\Result\Json $result */
58-
$result = $this->resultFactory->create(ResultFactory::TYPE_JSON);
59+
$result = $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData(['']);
5960
if (!$isAcknowledged) {
6061
$result->setHttpResponseCode(400);
6162
}

app/code/Magento/AsynchronousOperations/Test/Unit/Controller/Adminhtml/Notification/DismissTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public function testExecute()
8181
->with(ResultFactory::TYPE_JSON, [])
8282
->willReturn($this->jsonResultMock);
8383

84+
$this->jsonResultMock->expects($this->once())
85+
->method('setData')
86+
->with([''])
87+
->willReturn($this->jsonResultMock);
88+
8489
$this->assertEquals($this->jsonResultMock, $this->model->execute());
8590
}
8691

@@ -98,6 +103,11 @@ public function testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedC
98103
->with(ResultFactory::TYPE_RAW, [])
99104
->willReturn($this->jsonResultMock);
100105

106+
$this->jsonResultMock->expects($this->once())
107+
->method('setData')
108+
->with([''])
109+
->willReturn($this->jsonResultMock);
110+
101111
$this->notificationManagementMock->expects($this->once())
102112
->method('acknowledgeBulks')
103113
->with($bulkUuids)

0 commit comments

Comments
 (0)