/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/IndexTest.php
57 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 10:44
22 окт 2025, 10:44
264bea2
Код
Авторство
О чём код?
<?php /** * Copyright 2013 Adobe * All Rights Reserved. */ namespace Magento\Backend\Controller\Adminhtml; use Magento\Framework\App\Request\Http as HttpRequest; /** * @magentoAppArea adminhtml * @magentoDbIsolation enabled */ class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendController { /** * Check not logged state * @covers \Magento\Backend\Controller\Adminhtml\Index\Index::execute */ public function testNotLoggedIndexAction() { $this->_auth->logout(); $this->dispatch('backend/admin/index/index'); /** @var $backendUrlModel \Magento\Backend\Model\UrlInterface */ $backendUrlModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( \Magento\Backend\Model\UrlInterface::class ); $backendUrlModel->turnOffSecretKey(); $url = $backendUrlModel->getUrl('admin'); $this->assertRedirect($this->stringStartsWith($url)); } /** * Check logged state * @covers \Magento\Backend\Controller\Adminhtml\Index\Index::execute * */ public function testLoggedIndexAction() { $this->dispatch('backend/admin/index/index'); $this->assertRedirect(); } /** * @covers \Magento\Backend\Controller\Adminhtml\Index\GlobalSearch::execute */ public function testGlobalSearchAction() { $this->getRequest()->setParam('isAjax', 'true'); $this->getRequest()->setMethod(HttpRequest::METHOD_POST); $this->getRequest()->setPostValue('query', 'dummy'); $this->dispatch('backend/admin/index/globalSearch'); $actual = $this->getResponse()->getBody(); $this->assertEquals([], json_decode($actual)); } }