37 $this->_storeManagerMock = $this->createMock(\
Magento\Store\Model\StoreManagerInterface::class);
38 $this->_storeMock = $this->createMock(\
Magento\Store\Model\Store::class);
39 $this->_storeManagerMock->expects(
44 $this->returnValue($this->_storeMock)
46 $this->requestMock = $this->createMock(\
Magento\Framework\
App\RequestInterface::class);
47 $this->subjectMock = $this->getMockBuilder(\
Magento\Framework\
App\Action\AbstractAction::class)
48 ->disableOriginalConstructor()
49 ->getMockForAbstractClass();
51 $this->_plugin = new \Magento\Store\App\Action\Plugin\StoreCheck($this->_storeManagerMock);
60 $this->_storeMock->expects($this->any())->method(
'isActive')->will($this->returnValue(
false));
61 $this->_plugin->beforeDispatch($this->subjectMock, $this->requestMock);
66 $this->_storeMock->expects($this->any())->method(
'isActive')->will($this->returnValue(
true));
67 $result = $this->_plugin->beforeDispatch($this->subjectMock, $this->requestMock);
testBeforeDispatchWhenStoreNotActive()
testBeforeDispatchWhenStoreIsActive()