File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
app/code/Magento/AsynchronousOperations
Controller/Adminhtml/Notification
Test/Unit/Controller/Adminhtml/Notification Expand file tree Collapse file tree 2 files changed +12
-5
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 ;
11
12
use Magento \Framework \Controller \ResultFactory ;
12
13
13
14
/**
14
15
* Class Bulk Notification Dismiss Controller
15
16
*/
16
- class Dismiss extends Action
17
+ class Dismiss extends Action implements HttpGetActionInterface
17
18
{
18
19
/**
19
20
* @var BulkNotificationManagement
@@ -43,7 +44,7 @@ protected function _isAllowed()
43
44
}
44
45
45
46
/**
46
- * { @inheritdoc}
47
+ * @inheritdoc
47
48
*/
48
49
public function execute ()
49
50
{
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 ;
14
15
use Magento \Framework \Controller \ResultFactory ;
15
16
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager ;
16
17
use PHPUnit \Framework \MockObject \MockObject ;
@@ -43,6 +44,11 @@ class DismissTest extends TestCase
43
44
*/
44
45
private $ jsonResultMock ;
45
46
47
+ /**
48
+ * @var MockObject
49
+ */
50
+ private $ rawResultMock ;
51
+
46
52
protected function setUp (): void
47
53
{
48
54
$ objectManager = new ObjectManager ($ this );
@@ -78,10 +84,10 @@ public function testExecute()
78
84
79
85
$ this ->resultFactoryMock ->expects ($ this ->once ())
80
86
->method ('create ' )
81
- ->with (ResultFactory::TYPE_JSON , [])
82
- ->willReturn ($ this ->jsonResultMock );
87
+ ->with (ResultFactory::TYPE_RAW , [])
88
+ ->willReturn ($ this ->rawResultMock );
83
89
84
- $ this ->assertEquals ($ this ->jsonResultMock , $ this ->model ->execute ());
90
+ $ this ->assertEquals ($ this ->rawResultMock , $ this ->model ->execute ());
85
91
}
86
92
87
93
public function testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedCorrectly ()
You can’t perform that action at this time.
0 commit comments