* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Tests\Data\Provider; use Symfony\Component\Intl\Data\Provider\RegionDataProvider; use Symfony\Component\Intl\Intl; use Symfony\Component\Intl\Locale; /** * @author Bernhard Schussek */ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest { // The below arrays document the state of the ICU data bundled with this package. protected static $territories = array( 'AC', 'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DG', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EA', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'EZ', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HN', 'HR', 'HT', 'HU', 'IC', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TA', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'UN', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'XK', 'YE', 'YT', 'ZA', 'ZM', 'ZW', ); /** * @var RegionDataProvider */ protected $dataProvider; protected function setUp() { parent::setUp(); $this->dataProvider = new RegionDataProvider( $this->getDataDirectory().'/'.Intl::REGION_DIR, $this->createEntryReader() ); } abstract protected function getDataDirectory(); public function testGetRegions() { $this->assertSame(static::$territories, $this->dataProvider->getRegions()); } /** * @dataProvider provideLocales */ public function testGetNames($displayLocale) { $countries = array_keys($this->dataProvider->getNames($displayLocale)); sort($countries); $this->assertSame(static::$territories, $countries); } public function testGetNamesDefaultLocale() { Locale::setDefault('de_AT'); $this->assertSame( $this->dataProvider->getNames('de_AT'), $this->dataProvider->getNames() ); } /** * @dataProvider provideLocaleAliases */ public function testGetNamesSupportsAliases($alias, $ofLocale) { // Can't use assertSame(), because some aliases contain scripts with // different collation (=order of output) than their aliased locale // e.g. sr_Latn_ME => sr_ME $this->assertEquals( $this->dataProvider->getNames($ofLocale), $this->dataProvider->getNames($alias) ); } /** * @dataProvider provideLocales */ public function testGetName($displayLocale) { $names = $this->dataProvider->getNames($displayLocale); foreach ($names as $country => $name) { $this->assertSame($name, $this->dataProvider->getName($country, $displayLocale)); } } } __halt_compiler();----SIGNATURE:----Q5DOV0d3oWT2lVlvD+z1+PT6SDaO0RW6puiMJ7oh+tPdGVeq5gpT/G3QHnL3HhbkDaF3m4wmo/kRpqSB3/6ycCsQOlNCAytap0I5HGoDDKNJ+psK/CJyPDmsc6CFERAEJ8bdsXB7YNTAMENZeclyYUcVvkUy0I3T28jkbA4IMP94PnKkgaoctPNNp+Pr7Mq7u2umczB2rkjRCnd3PQaJ2dM74UZLzulRNoKPrDWuNLmN6pzX8UhVVjdV3hKb20ugd9oqx30ypkT9jvn1nXma3tBBtz+mL36BePqowN5zPSNg3vdyiQOlRstgs1qwB1pgN4CRybnt4nG6jh8lbHpS+ff/DpFFb/jucikKGeGqN2MJ2wGxkIQ5nHjyiRiiRxhnFO8tnUYbnzS1DQbdL/KavIH198eC+HWnYfD2JafnQbgWkzSLQfuMUg8B+uANi6yS/pOR2xg0fYz7gypcradecN5QeZjELGus8hNvt3+cPYCxdE/mU87EzgU0W1awpszQNl9T6+AlSRzN0NABRopv+nsU1Y2IPOgu4qsxy3wJ4EQEKr++3Ya7kR1O1D7u1/lZ8wEudECcSbujnneSPFK+5R9EZ9QixidMS63KhMazcdgxisSFeBDhuSJlxkEVMbVflWSomqkUC/KQJ69Fv43Oa5+fR3k0Yc6rDF2DGGNebWM=----ATTACHMENT:----NzM5ODA5MTIwNTk0MDA0MSA1MzYzMTI4NDc4NDI0NDQxIDgwNzMxMzgxMzg2OTk5Mjk=