SitemapTest.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sitemap\Test\Unit\Model;
  7. use Magento\Framework\DataObject;
  8. use Magento\Framework\Filesystem;
  9. use Magento\Framework\Filesystem\Directory\Write as DirectoryWrite;
  10. use Magento\Framework\Filesystem\File\Write;
  11. use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
  12. use Magento\Sitemap\Helper\Data;
  13. use Magento\Sitemap\Model\ItemProvider\ConfigReaderInterface;
  14. use Magento\Sitemap\Model\ItemProvider\ItemProviderInterface;
  15. use Magento\Sitemap\Model\ResourceModel\Catalog\Category;
  16. use Magento\Sitemap\Model\ResourceModel\Catalog\CategoryFactory;
  17. use Magento\Sitemap\Model\ResourceModel\Catalog\Product;
  18. use Magento\Sitemap\Model\ResourceModel\Catalog\ProductFactory;
  19. use Magento\Sitemap\Model\ResourceModel\Cms\Page;
  20. use Magento\Sitemap\Model\ResourceModel\Cms\PageFactory;
  21. use Magento\Sitemap\Model\ResourceModel\Sitemap as SitemapResource;
  22. use Magento\Sitemap\Model\Sitemap;
  23. use Magento\Sitemap\Model\SitemapConfigReaderInterface;
  24. use Magento\Sitemap\Model\SitemapItem;
  25. use Magento\Store\Model\Store;
  26. use Magento\Store\Model\StoreManagerInterface;
  27. /**
  28. * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
  29. */
  30. class SitemapTest extends \PHPUnit\Framework\TestCase
  31. {
  32. /**
  33. * @var Data
  34. */
  35. private $helperMockSitemap;
  36. /**
  37. * @var SitemapResource
  38. */
  39. private $resourceMock;
  40. /**
  41. * @var Category
  42. */
  43. private $sitemapCategoryMock;
  44. /**
  45. * @var Product
  46. */
  47. private $sitemapProductMock;
  48. /**
  49. * @var Page
  50. */
  51. private $sitemapCmsPageMock;
  52. /**
  53. * @var Filesystem
  54. */
  55. private $filesystemMock;
  56. /**
  57. * @var DirectoryWrite
  58. */
  59. private $directoryMock;
  60. /**
  61. * @var Write
  62. */
  63. private $fileMock;
  64. /**
  65. * @var StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
  66. */
  67. private $storeManagerMock;
  68. /**
  69. * @var ItemProviderInterface|\PHPUnit_Framework_MockObject_MockObject
  70. */
  71. private $itemProviderMock;
  72. /**
  73. * @var ConfigReaderInterface|\PHPUnit_Framework_MockObject_MockObject
  74. */
  75. private $configReaderMock;
  76. /**
  77. * Set helper mocks, create resource model mock
  78. */
  79. protected function setUp()
  80. {
  81. $this->sitemapCategoryMock = $this->getMockBuilder(Category::class)
  82. ->disableOriginalConstructor()
  83. ->getMock();
  84. $this->sitemapProductMock = $this->getMockBuilder(Product::class)
  85. ->disableOriginalConstructor()
  86. ->getMock();
  87. $this->sitemapCmsPageMock = $this->getMockBuilder(Page::class)
  88. ->disableOriginalConstructor()
  89. ->getMock();
  90. $this->helperMockSitemap = $this->getMockBuilder(Data::class)
  91. ->disableOriginalConstructor()
  92. ->getMock();
  93. $resourceMethods = [
  94. '_construct',
  95. 'beginTransaction',
  96. 'rollBack',
  97. 'save',
  98. 'addCommitCallback',
  99. 'commit',
  100. '__wakeup',
  101. ];
  102. $this->resourceMock = $this->getMockBuilder(SitemapResource::class)
  103. ->setMethods($resourceMethods)
  104. ->disableOriginalConstructor()
  105. ->getMock();
  106. $this->resourceMock->expects($this->any())
  107. ->method('addCommitCallback')
  108. ->willReturnSelf();
  109. $this->fileMock = $this->createMock(Write::class);
  110. $this->directoryMock = $this->createMock(DirectoryWrite::class);
  111. $this->directoryMock->expects($this->any())
  112. ->method('openFile')
  113. ->willReturn($this->fileMock);
  114. $this->filesystemMock = $this->getMockBuilder(Filesystem::class)
  115. ->setMethods(['getDirectoryWrite'])
  116. ->disableOriginalConstructor()
  117. ->getMock();
  118. $this->filesystemMock->expects($this->any())
  119. ->method('getDirectoryWrite')
  120. ->willReturn($this->directoryMock);
  121. $this->configReaderMock = $this->getMockForAbstractClass(SitemapConfigReaderInterface::class);
  122. $this->itemProviderMock = $this->getMockForAbstractClass(ItemProviderInterface::class);
  123. }
  124. /**
  125. * Check not allowed sitemap path validation
  126. *
  127. * @expectedException \Magento\Framework\Exception\LocalizedException
  128. * @expectedExceptionMessage Please define a correct path.
  129. */
  130. public function testNotAllowedPath()
  131. {
  132. $model = $this->getModelMock();
  133. $model->setSitemapPath('../');
  134. $model->beforeSave();
  135. }
  136. /**
  137. * Check not exists sitemap path validation
  138. *
  139. * @expectedException \Magento\Framework\Exception\LocalizedException
  140. * @expectedExceptionMessage Please create the specified folder "" before saving the sitemap.
  141. */
  142. public function testPathNotExists()
  143. {
  144. $this->directoryMock->expects($this->once())
  145. ->method('isExist')
  146. ->willReturn(false);
  147. $model = $this->getModelMock();
  148. $model->beforeSave();
  149. }
  150. /**
  151. * Check not writable sitemap path validation
  152. *
  153. * @expectedException \Magento\Framework\Exception\LocalizedException
  154. * @expectedExceptionMessage Please make sure that "/" is writable by the web-server.
  155. */
  156. public function testPathNotWritable()
  157. {
  158. $this->directoryMock->expects($this->once())
  159. ->method('isExist')
  160. ->willReturn(true);
  161. $this->directoryMock->expects($this->once())
  162. ->method('isWritable')
  163. ->willReturn(false);
  164. $model = $this->getModelMock();
  165. $model->beforeSave();
  166. }
  167. //@codingStandardsIgnoreStart
  168. /**
  169. * Check invalid chars in sitemap filename validation
  170. *
  171. * @expectedException \Magento\Framework\Exception\LocalizedException
  172. * @expectedExceptionMessage Please use only letters (a-z or A-Z), numbers (0-9) or underscores (_) in the filename.
  173. * No spaces or other characters are allowed.
  174. */
  175. //@codingStandardsIgnoreEnd
  176. public function testFilenameInvalidChars()
  177. {
  178. $this->directoryMock->expects($this->once())
  179. ->method('isExist')
  180. ->willReturn(true);
  181. $this->directoryMock->expects($this->once())
  182. ->method('isWritable')
  183. ->willReturn(true);
  184. $model = $this->getModelMock();
  185. $model->setSitemapFilename('*sitemap?.xml');
  186. $model->beforeSave();
  187. }
  188. /**
  189. * Data provider for sitemaps
  190. *
  191. * 1) Limit set to 50000 urls and 10M per sitemap file (single file)
  192. * 2) Limit set to 1 url and 10M per sitemap file (multiple files, 1 record per file)
  193. * 3) Limit set to 50000 urls and 264 bytes per sitemap file (multiple files, 1 record per file)
  194. *
  195. * @static
  196. * @return array
  197. */
  198. public static function sitemapDataProvider()
  199. {
  200. $expectedSingleFile = ['/sitemap-1-1.xml' => __DIR__ . '/_files/sitemap-single.xml'];
  201. $expectedMultiFile = [
  202. '/sitemap-1-1.xml' => __DIR__ . '/_files/sitemap-1-1.xml',
  203. '/sitemap-1-2.xml' => __DIR__ . '/_files/sitemap-1-2.xml',
  204. '/sitemap-1-3.xml' => __DIR__ . '/_files/sitemap-1-3.xml',
  205. '/sitemap-1-4.xml' => __DIR__ . '/_files/sitemap-1-4.xml',
  206. '/sitemap.xml' => __DIR__ . '/_files/sitemap-index.xml',
  207. ];
  208. return [
  209. [50000, 10485760, $expectedSingleFile, 6],
  210. [1, 10485760, $expectedMultiFile, 18],
  211. [50000, 264, $expectedMultiFile, 18],
  212. ];
  213. }
  214. /**
  215. * Check generation of sitemaps
  216. *
  217. * @param int $maxLines
  218. * @param int $maxFileSize
  219. * @param array $expectedFile
  220. * @param int $expectedWrites
  221. * @dataProvider sitemapDataProvider
  222. */
  223. public function testGenerateXml($maxLines, $maxFileSize, $expectedFile, $expectedWrites)
  224. {
  225. $actualData = [];
  226. $model = $this->prepareSitemapModelMock(
  227. $actualData,
  228. $maxLines,
  229. $maxFileSize,
  230. $expectedFile,
  231. $expectedWrites,
  232. null
  233. );
  234. $model->generateXml();
  235. $this->assertCount(count($expectedFile), $actualData, 'Number of generated files is incorrect');
  236. foreach ($expectedFile as $expectedFileName => $expectedFilePath) {
  237. $this->assertArrayHasKey(
  238. $expectedFileName,
  239. $actualData,
  240. sprintf('File %s was not generated', $expectedFileName)
  241. );
  242. $this->assertXmlStringEqualsXmlFile($expectedFilePath, $actualData[$expectedFileName]);
  243. }
  244. }
  245. /**
  246. * Data provider for robots.txt
  247. *
  248. * @static
  249. * @return array
  250. */
  251. public static function robotsDataProvider()
  252. {
  253. $expectedSingleFile = ['/sitemap-1-1.xml' => __DIR__ . '/_files/sitemap-single.xml'];
  254. $expectedMultiFile = [
  255. '/sitemap-1-1.xml' => __DIR__ . '/_files/sitemap-1-1.xml',
  256. '/sitemap-1-2.xml' => __DIR__ . '/_files/sitemap-1-2.xml',
  257. '/sitemap-1-3.xml' => __DIR__ . '/_files/sitemap-1-3.xml',
  258. '/sitemap-1-4.xml' => __DIR__ . '/_files/sitemap-1-4.xml',
  259. '/sitemap.xml' => __DIR__ . '/_files/sitemap-index.xml',
  260. ];
  261. return [
  262. [
  263. 50000,
  264. 10485760,
  265. $expectedSingleFile,
  266. 6,
  267. [
  268. 'robotsStart' => '',
  269. 'robotsFinish' => 'Sitemap: http://store.com/sitemap.xml',
  270. 'pushToRobots' => 1
  271. ],
  272. ], // empty robots file
  273. [
  274. 50000,
  275. 10485760,
  276. $expectedSingleFile,
  277. 6,
  278. [
  279. 'robotsStart' => "User-agent: *",
  280. 'robotsFinish' => "User-agent: *" . PHP_EOL . 'Sitemap: http://store.com/sitemap.xml',
  281. 'pushToRobots' => 1
  282. ]
  283. ], // not empty robots file EOL
  284. [
  285. 1,
  286. 10485760,
  287. $expectedMultiFile,
  288. 18,
  289. [
  290. 'robotsStart' => "User-agent: *\r\n",
  291. 'robotsFinish' => "User-agent: *\r\n\r\nSitemap: http://store.com/sitemap.xml",
  292. 'pushToRobots' => 1
  293. ]
  294. ], // not empty robots file WIN
  295. [
  296. 50000,
  297. 264,
  298. $expectedMultiFile,
  299. 18,
  300. [
  301. 'robotsStart' => "User-agent: *\n",
  302. 'robotsFinish' => "User-agent: *\n\nSitemap: http://store.com/sitemap.xml",
  303. 'pushToRobots' => 1
  304. ]
  305. ], // not empty robots file UNIX
  306. [
  307. 50000,
  308. 10485760,
  309. $expectedSingleFile,
  310. 6,
  311. ['robotsStart' => '', 'robotsFinish' => '', 'pushToRobots' => 0]
  312. ] // empty robots file
  313. ];
  314. }
  315. /**
  316. * Check pushing of sitemaps to robots.txt
  317. *
  318. * @param int $maxLines
  319. * @param int $maxFileSize
  320. * @param array $expectedFile
  321. * @param int $expectedWrites
  322. * @param array $robotsInfo
  323. * @dataProvider robotsDataProvider
  324. */
  325. public function testAddSitemapToRobotsTxt($maxLines, $maxFileSize, $expectedFile, $expectedWrites, $robotsInfo)
  326. {
  327. $actualData = [];
  328. $model = $this->prepareSitemapModelMock(
  329. $actualData,
  330. $maxLines,
  331. $maxFileSize,
  332. $expectedFile,
  333. $expectedWrites,
  334. $robotsInfo
  335. );
  336. $model->generateXml();
  337. }
  338. /**
  339. * Prepare mock of Sitemap model
  340. *
  341. * @param array $actualData
  342. * @param int $maxLines
  343. * @param int $maxFileSize
  344. * @param array $expectedFile
  345. * @param int $expectedWrites
  346. * @param array $robotsInfo
  347. * @return Sitemap|PHPUnit_Framework_MockObject_MockObject
  348. * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  349. */
  350. protected function prepareSitemapModelMock(
  351. &$actualData,
  352. $maxLines,
  353. $maxFileSize,
  354. $expectedFile,
  355. $expectedWrites,
  356. $robotsInfo
  357. ) {
  358. // Check that all $expectedWrites lines were written
  359. $actualData = [];
  360. $currentFile = '';
  361. $streamWriteCallback = function ($str) use (&$actualData, &$currentFile) {
  362. if (!array_key_exists($currentFile, $actualData)) {
  363. $actualData[$currentFile] = '';
  364. }
  365. $actualData[$currentFile] .= $str;
  366. };
  367. // Check that all expected lines were written
  368. $this->fileMock->expects(
  369. $this->exactly($expectedWrites)
  370. )->method(
  371. 'write'
  372. )->will(
  373. $this->returnCallback($streamWriteCallback)
  374. );
  375. $checkFileCallback = function ($file) use (&$currentFile) {
  376. $currentFile = $file;
  377. };// Check that all expected file descriptors were created
  378. $this->directoryMock->expects($this->exactly(count($expectedFile)))->method('openFile')
  379. ->willReturnCallback($checkFileCallback);
  380. // Check that all file descriptors were closed
  381. $this->fileMock->expects($this->exactly(count($expectedFile)))
  382. ->method('close');
  383. if (count($expectedFile) == 1) {
  384. $this->directoryMock->expects($this->once())
  385. ->method('renameFile')
  386. ->willReturnCallback(function ($from, $to) {
  387. \PHPUnit\Framework\Assert::assertEquals('/sitemap-1-1.xml', $from);
  388. \PHPUnit\Framework\Assert::assertEquals('/sitemap.xml', $to);
  389. });
  390. }
  391. // Check robots txt
  392. $robotsStart = '';
  393. if (isset($robotsInfo['robotsStart'])) {
  394. $robotsStart = $robotsInfo['robotsStart'];
  395. }
  396. $robotsFinish = 'Sitemap: http://store.com/sitemap.xml';
  397. if (isset($robotsInfo['robotsFinish'])) {
  398. $robotsFinish = $robotsInfo['robotsFinish'];
  399. }
  400. $this->directoryMock->expects($this->any())
  401. ->method('readFile')
  402. ->willReturn($robotsStart);
  403. $this->directoryMock->expects($this->any())
  404. ->method('writeFile')
  405. ->with(
  406. $this->equalTo('robots.txt'),
  407. $this->equalTo($robotsFinish)
  408. );
  409. // Mock helper methods
  410. $pushToRobots = 0;
  411. if (isset($robotsInfo['pushToRobots'])) {
  412. $pushToRobots = (int)$robotsInfo['pushToRobots'];
  413. }
  414. $this->configReaderMock->expects($this->any())
  415. ->method('getMaximumLinesNumber')
  416. ->willReturn($maxLines);
  417. $this->configReaderMock->expects($this->any())
  418. ->method('getMaximumFileSize')
  419. ->willReturn($maxFileSize);
  420. $this->configReaderMock->expects($this->any())
  421. ->method('getEnableSubmissionRobots')
  422. ->willReturn($pushToRobots);
  423. $model = $this->getModelMock(true);
  424. $storeMock = $this->getMockBuilder(Store::class)
  425. ->setMethods(['isFrontUrlSecure', 'getBaseUrl'])
  426. ->disableOriginalConstructor()
  427. ->getMock();
  428. $storeMock->expects($this->atLeastOnce())
  429. ->method('isFrontUrlSecure')
  430. ->willReturn(false);
  431. $storeMock->expects($this->atLeastOnce())
  432. ->method('getBaseUrl')
  433. ->with($this->isType('string'), false)
  434. ->willReturn('http://store.com/');
  435. $this->storeManagerMock->expects($this->atLeastOnce())
  436. ->method('getStore')
  437. ->with(1)
  438. ->willReturn($storeMock);
  439. return $model;
  440. }
  441. /**
  442. * Get model mock object
  443. *
  444. * @param bool $mockBeforeSave
  445. * @return Sitemap|PHPUnit_Framework_MockObject_MockObject
  446. */
  447. protected function getModelMock($mockBeforeSave = false)
  448. {
  449. $methods = [
  450. '_construct',
  451. '_getResource',
  452. '_getBaseDir',
  453. '_getFileObject',
  454. '_afterSave',
  455. '_getCurrentDateTime',
  456. '_getCategoryItemsCollection',
  457. '_getProductItemsCollection',
  458. '_getPageItemsCollection',
  459. '_getDocumentRoot',
  460. ];
  461. if ($mockBeforeSave) {
  462. $methods[] = 'beforeSave';
  463. }
  464. $storeBaseMediaUrl = 'http://store.com/pub/media/catalog/product/cache/c9e0b0ef589f3508e5ba515cde53c5ff/';
  465. $this->itemProviderMock->expects($this->any())
  466. ->method('getItems')
  467. ->willReturn([
  468. new SitemapItem('category.html', '1.0', 'daily', '2012-12-21 00:00:00'),
  469. new SitemapItem('/category/sub-category.html', '1.0', 'daily', '2012-12-21 00:00:00'),
  470. new SitemapItem('product.html', '0.5', 'monthly', '0000-00-00 00:00:00'),
  471. new SitemapItem(
  472. 'product2.html',
  473. '0.5',
  474. 'monthly',
  475. '2012-12-21 00:00:00',
  476. new DataObject([
  477. 'collection' => [
  478. new DataObject(
  479. [
  480. 'url' => $storeBaseMediaUrl . 'i/m/image1.png',
  481. 'caption' => 'caption & > title < "'
  482. ]
  483. ),
  484. new DataObject(
  485. ['url' => $storeBaseMediaUrl . 'i/m/image_no_caption.png', 'caption' => null]
  486. ),
  487. ],
  488. 'thumbnail' => $storeBaseMediaUrl . 't/h/thumbnail.jpg',
  489. 'title' => 'Product & > title < "',
  490. ])
  491. )
  492. ]);
  493. /** @var $model Sitemap */
  494. $model = $this->getMockBuilder(Sitemap::class)
  495. ->setMethods($methods)
  496. ->setConstructorArgs($this->getModelConstructorArgs())
  497. ->getMock();
  498. $model->expects($this->any())
  499. ->method('_getResource')
  500. ->willReturn($this->resourceMock);
  501. $model->expects($this->any())
  502. ->method('_getCurrentDateTime')
  503. ->willReturn('2012-12-21T00:00:00-08:00');
  504. $model->expects($this->any())
  505. ->method('_getDocumentRoot')
  506. ->willReturn('/project');
  507. $model->setSitemapFilename('sitemap.xml');
  508. $model->setStoreId(1);
  509. $model->setSitemapPath('/');
  510. return $model;
  511. }
  512. /**
  513. * @return array
  514. */
  515. private function getModelConstructorArgs()
  516. {
  517. $categoryFactory = $this->getMockBuilder(CategoryFactory::class)
  518. ->disableOriginalConstructor()
  519. ->getMock();
  520. $productFactory = $this->getMockBuilder(ProductFactory::class)
  521. ->disableOriginalConstructor()
  522. ->getMock();
  523. $cmsFactory = $this->getMockBuilder(PageFactory::class)
  524. ->disableOriginalConstructor()
  525. ->getMock();
  526. $this->storeManagerMock = $this->getMockBuilder(StoreManagerInterface::class)
  527. ->setMethods(['getStore'])
  528. ->getMockForAbstractClass();
  529. $objectManager = new ObjectManager($this);
  530. $constructArguments = $objectManager->getConstructArguments(
  531. Sitemap::class,
  532. [
  533. 'categoryFactory' => $categoryFactory,
  534. 'productFactory' => $productFactory,
  535. 'cmsFactory' => $cmsFactory,
  536. 'storeManager' => $this->storeManagerMock,
  537. 'sitemapData' => $this->helperMockSitemap,
  538. 'filesystem' => $this->filesystemMock,
  539. 'itemProvider' => $this->itemProviderMock,
  540. 'configReader' => $this->configReaderMock,
  541. ]
  542. );
  543. $constructArguments['resource'] = null;
  544. return $constructArguments;
  545. }
  546. /**
  547. * Check site URL getter
  548. *
  549. * @param string $storeBaseUrl
  550. * @param string $documentRoot
  551. * @param string $baseDir
  552. * @param string $sitemapPath
  553. * @param string $sitemapFileName
  554. * @param string $result
  555. * @dataProvider siteUrlDataProvider
  556. */
  557. public function testGetSitemapUrl($storeBaseUrl, $documentRoot, $baseDir, $sitemapPath, $sitemapFileName, $result)
  558. {
  559. /** @var $model Sitemap */
  560. $model = $this->getMockBuilder(Sitemap::class)
  561. ->setMethods(
  562. [
  563. '_getStoreBaseUrl',
  564. '_getDocumentRoot',
  565. '_getBaseDir',
  566. '_construct',
  567. ]
  568. )
  569. ->setConstructorArgs($this->getModelConstructorArgs())
  570. ->getMock();
  571. $model->expects($this->any())
  572. ->method('_getStoreBaseUrl')
  573. ->willReturn($storeBaseUrl);
  574. $model->expects($this->any())
  575. ->method('_getDocumentRoot')
  576. ->willReturn($documentRoot);
  577. $model->expects($this->any())
  578. ->method('_getBaseDir')
  579. ->willReturn($baseDir);
  580. $this->assertEquals($result, $model->getSitemapUrl($sitemapPath, $sitemapFileName));
  581. }
  582. /**
  583. * Data provider for Check site URL getter
  584. *
  585. * @static
  586. * @return array
  587. */
  588. public static function siteUrlDataProvider()
  589. {
  590. return [
  591. [
  592. 'http://store.com',
  593. 'c:\\http\\mage2\\',
  594. 'c:\\http\\mage2\\',
  595. '/',
  596. 'sitemap.xml',
  597. 'http://store.com/sitemap.xml',
  598. ],
  599. [
  600. 'http://store.com/store2',
  601. 'c:\\http\\mage2\\',
  602. 'c:\\http\\mage2\\',
  603. '/sitemaps/store2',
  604. 'sitemap.xml',
  605. 'http://store.com/sitemaps/store2/sitemap.xml'
  606. ],
  607. [
  608. 'http://store.com/builds/regression/ee/',
  609. '/var/www/html',
  610. '/opt/builds/regression/ee',
  611. '/',
  612. 'sitemap.xml',
  613. 'http://store.com/builds/regression/ee/sitemap.xml'
  614. ],
  615. [
  616. 'http://store.com/store2',
  617. 'c:\\http\\mage2\\',
  618. 'c:\\http\\mage2\\store2',
  619. '/sitemaps/store2',
  620. 'sitemap.xml',
  621. 'http://store.com/store2/sitemaps/store2/sitemap.xml'
  622. ],
  623. [
  624. 'http://store2.store.com',
  625. 'c:\\http\\mage2\\',
  626. 'c:\\http\\mage2\\',
  627. '/sitemaps/store2',
  628. 'sitemap.xml',
  629. 'http://store2.store.com/sitemaps/store2/sitemap.xml'
  630. ],
  631. [
  632. 'http://store.com',
  633. '/var/www/store/',
  634. '/var/www/store/',
  635. '/',
  636. 'sitemap.xml',
  637. 'http://store.com/sitemap.xml'
  638. ],
  639. [
  640. 'http://store.com/store2',
  641. '/var/www/store/',
  642. '/var/www/store/store2/',
  643. '/sitemaps/store2',
  644. 'sitemap.xml',
  645. 'http://store.com/store2/sitemaps/store2/sitemap.xml'
  646. ]
  647. ];
  648. }
  649. }