コード例 #1
0
 /**
  * @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;
 }
コード例 #2
0
 /**
  * @param int $group
  * @param string $countriesData
  * @param array $countriesList
  * @dataProvider getGroupCountryListDataProvider
  */
 public function testGetGroupCountryList($group, $countriesData, $countriesList)
 {
     $this->scopeConfig->expects($this->any())->method('getFrontendWebsiteOrBackendValue')->with("tobai_geo_store_switcher/group_{$group}/country_list")->willReturn($countriesData);
     $this->assertEquals($countriesList, $this->configGeneral->getGroupCountryList($group));
 }