FooterTest.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Block\Html;
  7. use Magento\Customer\Model\Context;
  8. class FooterTest extends \PHPUnit\Framework\TestCase
  9. {
  10. /**
  11. * @var \Magento\Theme\Model\Theme
  12. */
  13. protected $_theme;
  14. protected function setUp()
  15. {
  16. \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\App\State::class)
  17. ->setAreaCode('frontend');
  18. $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
  19. \Magento\Framework\View\DesignInterface::class
  20. );
  21. $this->_theme = $design->setDefaultDesignTheme()->getDesignTheme();
  22. }
  23. public function testGetCacheKeyInfo()
  24. {
  25. $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
  26. $context = $objectManager->get(\Magento\Framework\App\Http\Context::class);
  27. $context->setValue(Context::CONTEXT_AUTH, false, false);
  28. $block = $objectManager->get(\Magento\Framework\View\LayoutInterface::class)
  29. ->createBlock(\Magento\Theme\Block\Html\Footer::class);
  30. $storeId = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->getStore()->getId();
  31. $this->assertEquals(
  32. ['PAGE_FOOTER', $storeId, 0, $this->_theme->getId(), false, $block->getTemplateFile(), 'template' => null],
  33. $block->getCacheKeyInfo()
  34. );
  35. }
  36. }