diff --git a/Tests/Util/CountriesInfoTest.php b/Tests/Util/CountriesInfoTest.php new file mode 100644 index 000000000..955ec4382 --- /dev/null +++ b/Tests/Util/CountriesInfoTest.php @@ -0,0 +1,48 @@ +assertStringStartsWith("AS AF AFG 004 Afghanistan, Islamic Republic of", + $raw); + } + + public function testGetArrayCountriesData() + { + $data = CountriesInfo::getArrayCountriesData(); + + $this->assertNotNull($data); + $this->assertContains(array( + "AS", "AF", "AFG", "004", "Afghanistan, Islamic Republic of" + ), $data); + } + + public function testGetCountryCodeByContinents() + { + $countries = CountriesInfo::getCountriesCodeByContinent('EU'); + + $this->assertContains('BE', $countries); + $this->assertContains('FR', $countries); + $this->assertContains('GB', $countries); + } + + public function getGetContinentsCodes() + { + $continents = CountriesInfo::getContinentsCodes(); + + $this->assertContains('EU', $continents); + } +} diff --git a/Util/CountriesInfo.php b/Util/CountriesInfo.php new file mode 100644 index 000000000..a6dfbee49 --- /dev/null +++ b/Util/CountriesInfo.php @@ -0,0 +1,361 @@ +