Skip to content

Commit 8a98f20

Browse files
committed
Fix wrong interface implementation.
1 parent 9e6f56b commit 8a98f20

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/ProductsViewed.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9+
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
911
/**
1012
* Get most viewed products controller.
1113
*/
12-
class ProductsViewed extends AjaxBlock
14+
class ProductsViewed extends AjaxBlock implements HttpPostActionInterface
1315
{
1416
/**
1517
* Gets most viewed products list

dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/Dashboard/ProductsViewedTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
78
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
89

10+
/**
11+
* Test product viewed backend controller.
12+
*/
913
class ProductsViewedTest extends \Magento\TestFramework\TestCase\AbstractBackendController
1014
{
1115
/**
@@ -14,6 +18,7 @@ class ProductsViewedTest extends \Magento\TestFramework\TestCase\AbstractBackend
1418
*/
1519
public function testExecute()
1620
{
21+
$this->getRequest()->setMethod("POST");
1722
$this->dispatch('backend/admin/dashboard/productsViewed/');
1823

1924
$this->assertEquals(200, $this->getResponse()->getHttpResponseCode());

0 commit comments

Comments
 (0)