PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 1ms

/dev/tests/integration/testsuite/Mage/Sitemap/Helper/DataTest.php

https://bitbucket.org/jokusafet/magento2
PHP | 134 lines | 63 code | 13 blank | 58 comment | 0 complexity | ce286c85472440c375d7cd92bfaf2e87 MD5 | raw file
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Magento
  22. * @package Magento_Sitemap
  23. * @subpackage integration_tests
  24. * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
  25. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  26. */
  27. class Mage_Sitemap_Helper_DataTest extends PHPUnit_Framework_TestCase
  28. {
  29. /**
  30. * @var Mage_Sitemap_Helper_Data
  31. */
  32. protected $_helper = null;
  33. protected function setUp()
  34. {
  35. $this->_helper = Mage::helper('Mage_Sitemap_Helper_Data');
  36. }
  37. protected function tearDown()
  38. {
  39. unset($this->_helper);
  40. }
  41. /**
  42. * @magentoConfigFixture default_store sitemap/limit/max_lines 10
  43. */
  44. public function testGetMaximumLinesNumber()
  45. {
  46. $this->assertEquals(50000, $this->_helper->getMaximumLinesNumber(Mage_Core_Model_App::ADMIN_STORE_ID));
  47. $this->assertEquals(10, $this->_helper->getMaximumLinesNumber(Mage_Core_Model_App::DISTRO_STORE_ID));
  48. }
  49. /**
  50. * @magentoConfigFixture default_store sitemap/limit/max_file_size 1024
  51. */
  52. public function testGetMaximumFileSize()
  53. {
  54. $this->assertEquals(10485760, $this->_helper->getMaximumFileSize(Mage_Core_Model_App::ADMIN_STORE_ID));
  55. $this->assertEquals(1024, $this->_helper->getMaximumFileSize(Mage_Core_Model_App::DISTRO_STORE_ID));
  56. }
  57. /**
  58. * @magentoConfigFixture default_store sitemap/category/changefreq montly
  59. */
  60. public function testGetCategoryChangefreq()
  61. {
  62. $this->assertEquals('daily', $this->_helper->getCategoryChangefreq(Mage_Core_Model_App::ADMIN_STORE_ID));
  63. $this->assertEquals('montly', $this->_helper->getCategoryChangefreq(Mage_Core_Model_App::DISTRO_STORE_ID));
  64. }
  65. /**
  66. * @magentoConfigFixture default_store sitemap/product/changefreq montly
  67. */
  68. public function testGetProductChangefreq()
  69. {
  70. $this->assertEquals('daily', $this->_helper->getProductChangefreq(Mage_Core_Model_App::ADMIN_STORE_ID));
  71. $this->assertEquals('montly', $this->_helper->getProductChangefreq(Mage_Core_Model_App::DISTRO_STORE_ID));
  72. }
  73. /**
  74. * @magentoConfigFixture default_store sitemap/page/changefreq montly
  75. */
  76. public function testGetPageChangefreq()
  77. {
  78. $this->assertEquals('daily', $this->_helper->getPageChangefreq(Mage_Core_Model_App::ADMIN_STORE_ID));
  79. $this->assertEquals('montly', $this->_helper->getPageChangefreq(Mage_Core_Model_App::DISTRO_STORE_ID));
  80. }
  81. /**
  82. * @magentoConfigFixture default_store sitemap/category/priority 100
  83. */
  84. public function testGetCategoryPriority()
  85. {
  86. $this->assertEquals(0.5, $this->_helper->getCategoryPriority(Mage_Core_Model_App::ADMIN_STORE_ID));
  87. $this->assertEquals(100, $this->_helper->getCategoryPriority(Mage_Core_Model_App::DISTRO_STORE_ID));
  88. }
  89. /**
  90. * @magentoConfigFixture default_store sitemap/product/priority 100
  91. */
  92. public function testGetProductPriority()
  93. {
  94. $this->assertEquals(1, $this->_helper->getProductPriority(Mage_Core_Model_App::ADMIN_STORE_ID));
  95. $this->assertEquals(100, $this->_helper->getProductPriority(Mage_Core_Model_App::DISTRO_STORE_ID));
  96. }
  97. /**
  98. * @magentoConfigFixture default_store sitemap/page/priority 100
  99. */
  100. public function testGetPagePriority()
  101. {
  102. $this->assertEquals(0.25, $this->_helper->getPagePriority(Mage_Core_Model_App::ADMIN_STORE_ID));
  103. $this->assertEquals(100, $this->_helper->getPagePriority(Mage_Core_Model_App::DISTRO_STORE_ID));
  104. }
  105. /**
  106. * @magentoConfigFixture default_store sitemap/search_engines/submission_robots 1
  107. */
  108. public function testGetEnableSubmissionRobots()
  109. {
  110. $this->assertEquals(0, $this->_helper->getEnableSubmissionRobots(Mage_Core_Model_App::ADMIN_STORE_ID));
  111. $this->assertEquals(1, $this->_helper->getEnableSubmissionRobots(Mage_Core_Model_App::DISTRO_STORE_ID));
  112. }
  113. /**
  114. * @magentoConfigFixture default_store sitemap/product/image_include base
  115. */
  116. public function testGetProductImageIncludePolicy()
  117. {
  118. $this->assertEquals('all', $this->_helper->getProductImageIncludePolicy(Mage_Core_Model_App::ADMIN_STORE_ID));
  119. $this->assertEquals('base', $this->_helper->getProductImageIncludePolicy(Mage_Core_Model_App::DISTRO_STORE_ID));
  120. }
  121. }