/** * @param int|bool $storeId * @param string $countryCode * @return int */ public function updateStoreId($storeId, $countryCode) { if (!$this->generalConfig->isMappingSore()) { return $storeId; } $countryStoreCode = strtolower($countryCode); if (in_array($countryStoreCode, $this->getWebsite($storeId)->getStoreCodes())) { $storeId = $this->storeRepository->get($countryStoreCode)->getId(); } return $storeId; }
public function testIsMappingSore() { $isMappingSore = 1; $this->scopeConfig->expects($this->once())->method('getWebsiteValue')->with('tobai_geo_store_switcher/general/mapping_sore')->willReturn($isMappingSore); $this->assertTrue($this->configGeneral->isMappingSore()); }