Skip to content

Commit ffaaaaf

Browse files
committed
ACP2E-1405: Rollback the delivered code from the mainline and deliver correct branch ACP2E-1245
1 parent 88745a8 commit ffaaaaf

File tree

2 files changed

+6
-13
lines changed
  • app/code/Magento/AsynchronousOperations

2 files changed

+6
-13
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
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\HttpGetActionInterface;
1211
use Magento\Framework\Controller\ResultFactory;
1312

1413
/**
1514
* Class Bulk Notification Dismiss Controller
1615
*/
17-
class Dismiss extends Action implements HttpGetActionInterface
16+
class Dismiss extends Action
1817
{
1918
/**
2019
* @var BulkNotificationManagement
@@ -44,7 +43,7 @@ protected function _isAllowed()
4443
}
4544

4645
/**
47-
* @inheritdoc
46+
* {@inheritdoc}
4847
*/
4948
public function execute()
5049
{
@@ -56,7 +55,7 @@ public function execute()
5655
$isAcknowledged = $this->notificationManagement->acknowledgeBulks($bulkUuids);
5756

5857
/** @var \Magento\Framework\Controller\Result\Json $result */
59-
$result = $this->resultFactory->create(ResultFactory::TYPE_RAW);
58+
$result = $this->resultFactory->create(ResultFactory::TYPE_JSON);
6059
if (!$isAcknowledged) {
6160
$result->setHttpResponseCode(400);
6261
}

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\AsynchronousOperations\Model\BulkNotificationManagement;
1212
use Magento\Framework\App\RequestInterface;
1313
use Magento\Framework\Controller\Result\Json;
14-
use Magento\Framework\Controller\Result\Raw;
1514
use Magento\Framework\Controller\ResultFactory;
1615
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1716
use PHPUnit\Framework\MockObject\MockObject;
@@ -44,11 +43,6 @@ class DismissTest extends TestCase
4443
*/
4544
private $jsonResultMock;
4645

47-
/**
48-
* @var MockObject
49-
*/
50-
private $rawResultMock;
51-
5246
protected function setUp(): void
5347
{
5448
$objectManager = new ObjectManager($this);
@@ -84,10 +78,10 @@ public function testExecute()
8478

8579
$this->resultFactoryMock->expects($this->once())
8680
->method('create')
87-
->with(ResultFactory::TYPE_RAW, [])
88-
->willReturn($this->rawResultMock);
81+
->with(ResultFactory::TYPE_JSON, [])
82+
->willReturn($this->jsonResultMock);
8983

90-
$this->assertEquals($this->rawResultMock, $this->model->execute());
84+
$this->assertEquals($this->jsonResultMock, $this->model->execute());
9185
}
9286

9387
public function testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedCorrectly()

0 commit comments

Comments
 (0)