Skip to content

Commit 62da7cb

Browse files
committed
MC-24840: Infinite redirect in case of backend URL is different from default website URL
1 parent ef5e202 commit 62da7cb

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Backend\App\Area;
10+
11+
use PHPUnit\Framework\TestCase;
12+
use Magento\TestFramework\Helper\Bootstrap;
13+
14+
/**
15+
* @magentoAppArea adminhtml
16+
*/
17+
class FrontNameResolverTest extends TestCase
18+
{
19+
/**
20+
* @var \Magento\Framework\ObjectManagerInterface
21+
*/
22+
protected $objectManager;
23+
24+
/**
25+
* @var FrontNameResolver
26+
*/
27+
protected $model;
28+
29+
/**
30+
* @inheritDoc
31+
*/
32+
protected function setUp(): void
33+
{
34+
$this->objectManager = Bootstrap::getObjectManager();
35+
$this->model = $this->objectManager->create(
36+
FrontNameResolver::class
37+
);
38+
$_SERVER['HTTP_HOST'] = 'localhost';
39+
}
40+
41+
/**
42+
* @magentoDbIsolation enabled
43+
* @magentoConfigFixture current_store web/unsecure/base_url http://example.com/
44+
*/
45+
public function testIsHostBackend()
46+
{
47+
$this->assertTrue($this->model->isHostBackend());
48+
}
49+
}

0 commit comments

Comments
 (0)