Skip to content

Commit dd1bdaf

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-93969: Declaring allowed HTTP methods for controllers
1 parent 116416f commit dd1bdaf

File tree

3 files changed

+12
-4
lines changed
  • app/code/Magento
    • Backend/Controller/Adminhtml/Dashboard
    • Integration/Controller/Adminhtml/Integration
  • dev/tests/functional/tests/app/Magento/Backend/Test/Handler/Ui

3 files changed

+12
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
9+
use Magento\Backend\Controller\Adminhtml\Dashboard as DashboardAction;
10+
use Magento\Framework\App\Action\HttpGetActionInterface;
11+
use Magento\Framework\App\Action\HttpPostActionInterface;
1012

11-
class Index extends \Magento\Backend\Controller\Adminhtml\Dashboard implements HttpGetActionInterface
13+
class Index extends DashboardAction implements HttpGetActionInterface, HttpPostActionInterface
1214
{
1315
/**
1416
* @var \Magento\Framework\View\Result\PageFactory

app/code/Magento/Integration/Controller/Adminhtml/Integration/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Magento\Integration\Controller\Adminhtml\Integration;
88

99
use Magento\Framework\App\Action\HttpGetActionInterface;
10-
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
10+
use Magento\Framework\App\Action\HttpPostActionInterface;
1111
use Magento\Integration\Controller\Adminhtml\Integration as IntegrationAction;
1212

1313
class Grid extends IntegrationAction implements HttpPostActionInterface, HttpGetActionInterface

dev/tests/functional/tests/app/Magento/Backend/Test/Handler/Ui/LoginUser.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\Backend\Test\Handler\Ui;
88

9+
use Magento\Backend\Test\Page\AdminAuthLogin;
910
use Magento\Mtf\Factory\Factory;
1011
use Magento\Mtf\Fixture\FixtureInterface;
1112
use Magento\Mtf\Handler\Ui;
@@ -29,10 +30,15 @@ public function persist(FixtureInterface $fixture = null)
2930
$fixture = Factory::getFixtureFactory()->getMagentoBackendAdminSuperAdmin();
3031
}
3132

33+
/** @var AdminAuthLogin $loginPage */
3234
$loginPage = Factory::getPageFactory()->getAdminAuthLogin();
3335
$loginForm = $loginPage->getLoginBlock();
34-
3536
$adminHeaderPanel = $loginPage->getHeaderBlock();
37+
if (!$loginForm->isVisible() && !$adminHeaderPanel->isVisible()) {
38+
//We are currently not in the admin area.
39+
$loginPage->open();
40+
}
41+
3642
if (!$adminHeaderPanel || !$adminHeaderPanel->isVisible()) {
3743
$loginPage->open();
3844
if ($adminHeaderPanel->isVisible()) {

0 commit comments

Comments
 (0)