123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Framework\View\Test\Unit;
- class DesignLoaderTest extends \PHPUnit\Framework\TestCase
- {
- /**
- * @var \Magento\Framework\View\DesignLoader
- */
- protected $_model;
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- protected $_areaListMock;
- /**
- * @var \PHPUnit_Framework_MockObject_MockObject
- */
- protected $_requestMock;
- /**
- * @var \Magento\Framework\App\State|\PHPUnit_Framework_MockObject_MockObject
- */
- protected $appState;
- protected function setUp()
- {
- $this->_areaListMock = $this->createMock(\Magento\Framework\App\AreaList::class);
- $this->_requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class);
- $this->appState = $this->createMock(\Magento\Framework\App\State::class);
- $this->_model = new \Magento\Framework\View\DesignLoader(
- $this->_requestMock,
- $this->_areaListMock,
- $this->appState
- );
- }
- public function testLoad()
- {
- $area = $this->createMock(\Magento\Framework\App\Area::class);
- $this->appState->expects($this->once())->method('getAreaCode')->will($this->returnValue('area'));
- $this->_areaListMock->expects($this->once())->method('getArea')->with('area')->will($this->returnValue($area));
- $area->expects($this->at(0))->method('load')
- ->with(\Magento\Framework\App\Area::PART_DESIGN)->will($this->returnValue($area));
- $area->expects($this->at(1))->method('load')
- ->with(\Magento\Framework\App\Area::PART_TRANSLATE)->will($this->returnValue($area));
- $this->_model->load($this->_requestMock);
- }
- }
|