public function testAroundDispatchIfBaseUrlNotExists() { $this->_requestMock->expects($this->once())->method('setDispatched')->with(false); $this->_scopeConfigMock->expects($this->once())->method('getValue')->with('marketing/url/redirect_to_base')->will($this->returnValue(302)); $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->_storeMock)); $this->_storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue(false)); $this->_requestMock->expects($this->never())->method('getRequestUri'); $this->assertEquals('Expected', $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->_requestMock)); }
public function testAroundDispatchIfBaseUrlNotExists() { $this->_requestMock->expects($this->once())->method('setDispatched')->with(false); $this->_storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->_storeMock)); $this->_storeMock->expects($this->once())->method('getBaseUrl')->will($this->returnValue(false)); $this->_requestMock->expects($this->never())->method('getRequestUri'); $this->baseUrlChecker->expects($this->any())->method('isEnabled')->willReturn(true); $this->assertEquals('Expected', $this->_model->aroundDispatch($this->subjectMock, $this->closureMock, $this->_requestMock)); }