8
8
9
9
namespace Magento \Sitemap \Model ;
10
10
11
- use Magento \Framework \App \Config \Value ;
12
11
use Magento \Framework \App \Filesystem \DirectoryList ;
13
12
use Magento \Framework \Filesystem ;
14
13
use Magento \Framework \ObjectManagerInterface ;
18
17
use Zend \Stdlib \Parameters ;
19
18
use PHPUnit \Framework \TestCase ;
20
19
20
+ /**
21
+ * Test for Sitemap
22
+ */
21
23
class SitemapTest extends TestCase
22
24
{
23
25
/**
@@ -30,13 +32,19 @@ class SitemapTest extends TestCase
30
32
*/
31
33
private $ objectManager ;
32
34
35
+ /**
36
+ * @var Filesystem
37
+ */
38
+ private $ filesystem ;
39
+
33
40
/**
34
41
* @inheritdoc
35
42
*/
36
43
protected function setUp ()
37
44
{
38
45
$ this ->objectManager = Bootstrap::getObjectManager ();
39
46
$ this ->model = $ this ->objectManager ->get (Sitemap::class);
47
+ $ this ->filesystem = $ this ->objectManager ->get (Filesystem::class);
40
48
}
41
49
42
50
/**
@@ -46,14 +54,9 @@ protected function setUp()
46
54
*/
47
55
public function testGetSitemapUrlFromParentRootDirectoryPath (): void
48
56
{
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/ ' ;
53
58
54
- /** @var Filesystem $filesystem */
55
- $ filesystem = $ this ->objectManager ->create (Filesystem::class);
56
- $ rootDir = $ filesystem ->getDirectoryRead (DirectoryList::ROOT )
59
+ $ rootDir = $ this ->filesystem ->getDirectoryRead (DirectoryList::ROOT )
57
60
->getAbsolutePath ();
58
61
$ requestPath = dirname ($ rootDir );
59
62
0 commit comments