EmulationTest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Store\Model\App;
  7. class EmulationTest extends \PHPUnit\Framework\TestCase
  8. {
  9. /**
  10. * @var \Magento\Store\Model\App\Emulation
  11. */
  12. protected $_model;
  13. /**
  14. * @covers \Magento\Store\Model\App\Emulation::startEnvironmentEmulation
  15. * @covers \Magento\Store\Model\App\Emulation::stopEnvironmentEmulation
  16. */
  17. public function testEnvironmentEmulation()
  18. {
  19. $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  20. ->create(\Magento\Store\Model\App\Emulation::class);
  21. \Magento\TestFramework\Helper\Bootstrap::getInstance()
  22. ->loadArea(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE);
  23. $design = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
  24. ->get(\Magento\Framework\View\DesignInterface::class);
  25. $this->_model->startEnvironmentEmulation(1);
  26. $this->_model->stopEnvironmentEmulation();
  27. $this->assertEquals(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, $design->getArea());
  28. }
  29. }