public function testIsAvailable() { $this->appStateHelper->expects($this->once())->method('isFrontendArea')->willReturn(true); $this->scopeConfig->expects($this->any())->method('getStoreValue')->willReturnMap([['tobai_geo_store_switcher/general/white_ips', '127.0.0.1, 10.0.0.1'], ['tobai_geo_store_switcher/general/white_ua', '/^mozilla/i']]); $this->requestHelper->expects($this->once())->method('isCurrentIp')->with(['127.0.0.1', '10.0.0.1'])->willReturn(false); $this->requestHelper->expects($this->once())->method('isCurrentUserAgent')->with('/^mozilla/i')->willReturn(false); $this->scopeConfig->expects($this->once())->method('getFrontendStoreOrBackendValue')->with('tobai_geo_store_switcher/general/active')->willReturn(true); $this->assertTrue($this->configGeneral->isAvailable()); }
public function testGetFrontendWebsiteOrBackendValueBackendStoreScope() { $path = 'test-path'; $this->appStateHelper->expects($this->once())->method('isFrontendArea')->willReturn(false); $this->scopeDefiner->expects($this->atLeastOnce())->method('getScope')->willReturn(ScopeInterface::SCOPE_STORE); $this->scopeDefiner->expects($this->never())->method('getScopeValue'); $this->appScopeConfig->expects($this->never())->method('getValue'); $this->assertEmpty($this->scopeConfig->getFrontendWebsiteOrBackendValue($path)); }