SitemapConfigReaderTest.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sitemap\Model;
  7. use Magento\Store\Model\Store;
  8. use Magento\TestFramework\Helper\Bootstrap;
  9. class SitemapConfigReaderTest extends \PHPUnit\Framework\TestCase
  10. {
  11. /**
  12. * @var SitemapConfigReader
  13. */
  14. private $model = null;
  15. protected function setUp()
  16. {
  17. $this->model = Bootstrap::getObjectManager()->get(SitemapConfigReader::class);
  18. }
  19. /**
  20. * @magentoConfigFixture default_store sitemap/search_engines/submission_robots 1
  21. */
  22. public function testGetEnableSubmissionRobots()
  23. {
  24. $this->assertEquals(0, $this->model->getEnableSubmissionRobots(Store::DEFAULT_STORE_ID));
  25. $this->assertEquals(1, $this->model->getEnableSubmissionRobots(Store::DISTRO_STORE_ID));
  26. }
  27. /**
  28. * @magentoConfigFixture default_store sitemap/limit/max_lines 10
  29. */
  30. public function testGetMaximumLinesNumber()
  31. {
  32. $this->assertEquals(50000, $this->model->getMaximumLinesNumber(Store::DEFAULT_STORE_ID));
  33. $this->assertEquals(10, $this->model->getMaximumLinesNumber(Store::DISTRO_STORE_ID));
  34. }
  35. /**
  36. * @magentoConfigFixture default_store sitemap/limit/max_file_size 1024
  37. */
  38. public function testGetMaximumFileSize()
  39. {
  40. $this->assertEquals(10485760, $this->model->getMaximumFileSize(Store::DEFAULT_STORE_ID));
  41. $this->assertEquals(1024, $this->model->getMaximumFileSize(Store::DISTRO_STORE_ID));
  42. }
  43. /**
  44. * @magentoConfigFixture default_store sitemap/product/image_include base
  45. */
  46. public function testGetProductImageIncludePolicy()
  47. {
  48. $this->assertEquals('all', $this->model->getProductImageIncludePolicy(Store::DEFAULT_STORE_ID));
  49. $this->assertEquals('base', $this->model->getProductImageIncludePolicy(Store::DISTRO_STORE_ID));
  50. }
  51. }