GridTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Checkout\Block\Cart;
  7. /**
  8. * Class GridTest
  9. * Test to verify default config value for
  10. * Store->Configuration->Sales->Checkout->Shopping Cart->Number of items to display pager
  11. */
  12. class GridTest extends \PHPUnit\Framework\TestCase
  13. {
  14. public function testGetDefaultConfig()
  15. {
  16. $configValue = 20;
  17. /** @var $scopeConfig \Magento\Framework\App\Config\ScopeConfigInterface */
  18. $scopeConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  19. \Magento\Framework\App\Config\ScopeConfigInterface::class
  20. );
  21. $defaultConfigValue = $scopeConfig->getValue(
  22. \Magento\Checkout\Block\Cart\Grid::XPATH_CONFIG_NUMBER_ITEMS_TO_DISPLAY_PAGER,
  23. \Magento\Store\Model\ScopeInterface::SCOPE_STORE
  24. );
  25. $errorMessage = 'Default Config value for Store->Configuration->Sales->Checkout->Shopping Cart->'
  26. . 'Number of items to display pager shouold be ' . $configValue;
  27. $this->assertEquals($configValue, $defaultConfigValue, $errorMessage);
  28. }
  29. }