File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
app/code/Magento/AsynchronousOperations
Controller/Adminhtml/Notification
Test/Unit/Controller/Adminhtml/Notification Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 88use Magento \AsynchronousOperations \Model \BulkNotificationManagement ;
99use Magento \Backend \App \Action \Context ;
1010use Magento \Backend \App \Action ;
11+ use Magento \Framework \App \Action \HttpPostActionInterface ;
1112use 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 }
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments