FooterTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Theme\Test\Unit\Block\Html;
  7. class FooterTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Theme\Block\Html\Footer
  11. */
  12. protected $block;
  13. protected function setUp()
  14. {
  15. $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
  16. $this->block = $objectManager->getObject(\Magento\Theme\Block\Html\Footer::class);
  17. }
  18. protected function tearDown()
  19. {
  20. $this->block = null;
  21. }
  22. public function testGetIdentities()
  23. {
  24. $this->assertEquals(
  25. [\Magento\Store\Model\Store::CACHE_TAG, \Magento\Cms\Model\Block::CACHE_TAG],
  26. $this->block->getIdentities()
  27. );
  28. }
  29. /**
  30. * Check Footer block has cache lifetime.
  31. *
  32. * @throws \ReflectionException
  33. * @return void
  34. */
  35. public function testGetCacheLifetime()
  36. {
  37. $reflection = new \ReflectionClass($this->block);
  38. $method = $reflection->getMethod('getCacheLifetime');
  39. $method->setAccessible(true);
  40. $this->assertEquals(3600, $method->invoke($this->block));
  41. }
  42. }