_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); } }