Skip to content

Commit d94335a

Browse files
committed
MAGETWO-61060: [Backport] - Incorrect URLs in sitemap when generated from admin with 'Use Secure URLs in Admin' = Yes - for 2.0
1 parent c4c4838 commit d94335a

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
<?php
2-
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
36
namespace Magento\Sitemap\Model;
47

58
use Magento\Framework\App\CacheInterface;
69
use Magento\TestFramework\Helper\Bootstrap;
710
use Magento\Framework\App\Filesystem;
811

912
/**
10-
* Tests Magento\Framework\ComposerInformation
13+
* Tests class for Magento\Sitemap\Model\Sitemap.
14+
*
1115
*/
1216
class SitemapTest extends \PHPUnit_Framework_TestCase
1317
{
1418
/**
15-
* @var \Magento\Framework\ObjectManagerInterface
19+
* @var \Magento\Framework\ObjectManagerInterface.
1620
*/
1721
private $objectManager;
1822

1923
/**
20-
* @var \Magento\Sitemap\Model\Sitemap
24+
* @var \Magento\Sitemap\Model\Sitemap.
2125
*/
2226
private $sitemap;
2327

2428
/**
25-
* Remove cached configuration and reinitialize the application
29+
* Remove cached configuration and reinitialize the application.
2630
*/
2731
private function refreshConfiguration()
2832
{
@@ -41,14 +45,13 @@ public function setUp()
4145
}
4246

4347
/**
44-
* Test generation sitemap when secure url is on
48+
* Test generating sitemap.xml file when secure url option is on.
4549
*
4650
* @magentoDataFixture Magento/Sitemap/_files/sitemap_secure.php
4751
*/
4852
public function testGenerationWithAdminSecureUrl()
4953
{
5054
self::refreshConfiguration();
51-
5255
$this->sitemap->setData(
5356
[
5457
'sitemap_id' => '1',
@@ -57,15 +60,11 @@ public function testGenerationWithAdminSecureUrl()
5760
'store_id' => '1'
5861
]
5962
);
60-
6163
$result = $this->sitemap->generateXml();
62-
6364
$filename = BP . $result->getSitemapPath() . $result->getSitemapFilename();
6465

6566
$this->assertFileExists($filename, 'File not exists! ' . $filename);
66-
6767
$file = $this->objectManager->get(\Magento\Framework\Filesystem\Io\File::class);
68-
6968
$file_content = $file->read($filename);
7069

7170
$this->assertNotContains('https', $file_content, "File must not contain https in sitemap file! ");

dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_secure.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
26

37
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
48

dev/tests/integration/testsuite/Magento/Sitemap/_files/sitemap_secure_rollback.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?php
2+
/**
3+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
26

37
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
48

0 commit comments

Comments
 (0)