70 \
Magento\Framework\
App\RequestInterface::class,
71 [
'isDispatched',
'initForward',
'setDispatched',
'isForwarded']
74 \
Magento\Framework\View\Element\BlockInterface::class,
78 \
Magento\Framework\View\Element\BlockInterface::class,
79 [
'setActive',
'getMenuModel']
85 $this->layoutMock = $this->getMockBuilder(\
Magento\Framework\View\LayoutInterface::class)
86 ->disableOriginalConstructor()
88 $this->switcherBlockMock = $this->getMockBuilder(\
Magento\Framework\View\Element\BlockInterface::class)
89 ->disableOriginalConstructor()
91 $this->contextMock = $this->getMockBuilder(\
Magento\Backend\
App\Action\Context::class)
92 ->disableOriginalConstructor()
94 $this->fileFactoryMock = $this->getMockBuilder(\
Magento\Framework\
App\
Response\Http\FileFactory::class)
95 ->disableOriginalConstructor()
97 $this->menuModelMock = $this->getMockBuilder(\
Magento\Backend\Model\Menu::class)
98 ->disableOriginalConstructor()
100 $this->abstractBlockMock = $this->getMockBuilder(\
Magento\Framework\View\Element\AbstractBlock::class)
101 ->setMethods([
'getCsvFile',
'getExcelFile',
'setSaveParametersInSession',
'getCsv',
'getExcel'])
102 ->disableOriginalConstructor()
105 $this->menuModelMock->expects($this->any())->method(
'getParentItems')->willReturn([]);
106 $this->menuBlockMock->expects($this->any())->method(
'getMenuModel')->willReturn($this->menuModelMock);
107 $this->viewMock->expects($this->any())->method(
'getLayout')->willReturn($this->layoutMock);
108 $this->contextMock->expects($this->any())->method(
'getRequest')->willReturn($this->requestMock);
109 $this->contextMock->expects($this->any())->method(
'getView')->willReturn($this->viewMock);
111 $this->layoutMock->expects($this->any())->method(
'getBlock')->will(
112 $this->returnValueMap(
114 [
'breadcrumbs', $this->breadcrumbsBlockMock],
115 [
'menu', $this->menuBlockMock],
116 [
'store_switcher', $this->switcherBlockMock]
120 $this->layoutMock->expects($this->any())->method(
'getChildBlock')->willReturn($this->abstractBlockMock);
131 return $this->getMockForAbstractClass(
$className, [],
'',
false,
false,
true, $mockedMethods);
getMockForAbstractClassBuilder($className, $mockedMethods=[])