File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
app/code/Magento/AsynchronousOperations
Controller/Adminhtml/Notification
Test/Unit/Controller/Adminhtml/Notification Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 8
8
use Magento \AsynchronousOperations \Model \BulkNotificationManagement ;
9
9
use Magento \Backend \App \Action \Context ;
10
10
use Magento \Backend \App \Action ;
11
- use Magento \Framework \App \Action \HttpGetActionInterface ;
12
11
use Magento \Framework \Controller \ResultFactory ;
13
12
14
13
/**
15
14
* Class Bulk Notification Dismiss Controller
16
15
*/
17
- class Dismiss extends Action implements HttpGetActionInterface
16
+ class Dismiss extends Action
18
17
{
19
18
/**
20
19
* @var BulkNotificationManagement
@@ -44,7 +43,7 @@ protected function _isAllowed()
44
43
}
45
44
46
45
/**
47
- * @inheritdoc
46
+ * { @inheritdoc}
48
47
*/
49
48
public function execute ()
50
49
{
@@ -56,7 +55,7 @@ public function execute()
56
55
$ isAcknowledged = $ this ->notificationManagement ->acknowledgeBulks ($ bulkUuids );
57
56
58
57
/** @var \Magento\Framework\Controller\Result\Json $result */
59
- $ result = $ this ->resultFactory ->create (ResultFactory::TYPE_RAW );
58
+ $ result = $ this ->resultFactory ->create (ResultFactory::TYPE_JSON );
60
59
if (!$ isAcknowledged ) {
61
60
$ result ->setHttpResponseCode (400 );
62
61
}
Original file line number Diff line number Diff line change 11
11
use Magento \AsynchronousOperations \Model \BulkNotificationManagement ;
12
12
use Magento \Framework \App \RequestInterface ;
13
13
use Magento \Framework \Controller \Result \Json ;
14
- use Magento \Framework \Controller \Result \Raw ;
15
14
use Magento \Framework \Controller \ResultFactory ;
16
15
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
17
16
use PHPUnit \Framework \MockObject \MockObject ;
@@ -44,11 +43,6 @@ class DismissTest extends TestCase
44
43
*/
45
44
private $ jsonResultMock ;
46
45
47
- /**
48
- * @var MockObject
49
- */
50
- private $ rawResultMock ;
51
-
52
46
protected function setUp (): void
53
47
{
54
48
$ objectManager = new ObjectManager ($ this );
@@ -84,10 +78,10 @@ public function testExecute()
84
78
85
79
$ this ->resultFactoryMock ->expects ($ this ->once ())
86
80
->method ('create ' )
87
- ->with (ResultFactory::TYPE_RAW , [])
88
- ->willReturn ($ this ->rawResultMock );
81
+ ->with (ResultFactory::TYPE_JSON , [])
82
+ ->willReturn ($ this ->jsonResultMock );
89
83
90
- $ this ->assertEquals ($ this ->rawResultMock , $ this ->model ->execute ());
84
+ $ this ->assertEquals ($ this ->jsonResultMock , $ this ->model ->execute ());
91
85
}
92
86
93
87
public function testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedCorrectly ()
You can’t perform that action at this time.
0 commit comments