Skip to content

Commit 23f6fb5

Browse files
committed
ACP2E-1245: "Something went wrong" error is displayed when clearing the completed bulk tasks.
1 parent 44aa193 commit 23f6fb5

File tree

2 files changed

+12
-5
lines changed
  • app/code/Magento/AsynchronousOperations

2 files changed

+12
-5
lines changed

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

Lines changed: 3 additions & 2 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\HttpGetActionInterface;
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 HttpGetActionInterface
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
{

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
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;
1415
use Magento\Framework\Controller\ResultFactory;
1516
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
1617
use PHPUnit\Framework\MockObject\MockObject;
@@ -43,6 +44,11 @@ class DismissTest extends TestCase
4344
*/
4445
private $jsonResultMock;
4546

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

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

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

8793
public function testExecuteSetsBadRequestResponseStatusIfBulkWasNotAcknowledgedCorrectly()

0 commit comments

Comments
 (0)