Skip to content

Commit 071b47b

Browse files
MC-21860: Partial sitemaps have wrong urls in sitemap index
1 parent 4e3e5bd commit 071b47b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

dev/tests/integration/testsuite/Magento/Sitemap/Model/SitemapTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace Magento\Sitemap\Model;
1010

11-
use Magento\Framework\App\Config\Value;
1211
use Magento\Framework\App\Filesystem\DirectoryList;
1312
use Magento\Framework\Filesystem;
1413
use Magento\Framework\ObjectManagerInterface;
@@ -18,6 +17,9 @@
1817
use Zend\Stdlib\Parameters;
1918
use PHPUnit\Framework\TestCase;
2019

20+
/**
21+
* Test for Sitemap
22+
*/
2123
class SitemapTest extends TestCase
2224
{
2325
/**
@@ -30,13 +32,19 @@ class SitemapTest extends TestCase
3032
*/
3133
private $objectManager;
3234

35+
/**
36+
* @var Filesystem
37+
*/
38+
private $filesystem;
39+
3340
/**
3441
* @inheritdoc
3542
*/
3643
protected function setUp()
3744
{
3845
$this->objectManager = Bootstrap::getObjectManager();
3946
$this->model = $this->objectManager->get(Sitemap::class);
47+
$this->filesystem = $this->objectManager->get(Filesystem::class);
4048
}
4149

4250
/**
@@ -46,14 +54,9 @@ protected function setUp()
4654
*/
4755
public function testGetSitemapUrlFromParentRootDirectoryPath(): void
4856
{
49-
/** @var Value $configValue */
50-
$configValue = $this->objectManager->get(Value::class);
51-
$configValue->load('web/unsecure/base_url', 'path');
52-
$baseUrl = $configValue->getValue() ?: 'http://localhost/';
57+
$baseUrl = 'http://localhost/';
5358

54-
/** @var Filesystem $filesystem */
55-
$filesystem = $this->objectManager->create(Filesystem::class);
56-
$rootDir = $filesystem->getDirectoryRead(DirectoryList::ROOT)
59+
$rootDir = $this->filesystem->getDirectoryRead(DirectoryList::ROOT)
5760
->getAbsolutePath();
5861
$requestPath = dirname($rootDir);
5962

0 commit comments

Comments
 (0)