/** * @param string $countryCode * @return bool|int */ protected function getGroup($countryCode) { $groupCount = $this->generalConfig->getGroupCount(); for ($group = 1; $group <= $groupCount; $group++) { if (in_array($countryCode, $this->generalConfig->getGroupCountryList($group))) { return $group; } } return false; }
public function testGetGroupCount() { $isActive = true; $groupCount = 5; $this->scopeConfig->expects($this->once())->method('getFrontendStoreOrBackendValue')->with('tobai_geo_store_switcher/general/active')->willReturn($isActive); $this->scopeConfig->expects($this->once())->method('getFrontendWebsiteOrBackendValue')->with('tobai_geo_store_switcher/general/by_groups')->willReturn($groupCount); $this->assertEquals($groupCount, $this->configGeneral->getGroupCount()); }