diff --git a/src/Faker/Provider/de_CH/Address.php b/src/Faker/Provider/de_CH/Address.php new file mode 100644 index 0000000000..fe6a8a8e6b --- /dev/null +++ b/src/Faker/Provider/de_CH/Address.php @@ -0,0 +1,113 @@ + 'AG', 'name' => 'Aargau'), array('short' => 'AI', 'name' => 'Appenzell Innerrhoden'), array('short' => 'AR', 'name' => 'Appenzell Ausserrhoden'), array('short' => 'BE', 'name' => 'Bern'), array('short' => 'BL', 'name' => 'Basel-Landschaft'), array('short' => 'BS', 'name' => 'Basel-Stadt'), array('short' => 'FR', 'name' => 'Freiburg'), array('short' => 'GE', 'name' => 'Genf'), array('short' => 'GL', 'name' => 'Glarus'), array('short' => 'GR', 'name' => 'Graubünden'), array('short' => 'JU', 'name' => 'Jura',), array('short' => 'LU', 'name' => 'Luzern'), array('short' => 'NE', 'name' => 'Neuenburg'), array('short' => 'NW', 'name' => 'Nidwalden'), array('short' => 'OW', 'name' => 'Obwalden'), array('short' => 'SG', 'name' => 'St. Gallen'), array('short' => 'SH', 'name' => 'Schaffhausen'), array('short' => 'SO', 'name' => 'Solothurn'), array('short' => 'SZ', 'name' => 'Schwyz'), array('short' => 'TG', 'name' => 'Thurgau'), array('short' => 'TI', 'name' => 'Tessin'), array('short' => 'UR', 'name' => 'Uri'), array('short' => 'VD', 'name' => 'Waadt'), array('short' => 'VS', 'name' => 'Wallis'), array('short' => 'ZG', 'name' => 'Zug'), array('short' => 'ZH', 'name' => 'Zürich') + ); + + protected static $country = array( + 'Afghanistan', 'Alandinseln', 'Albanien', 'Algerien', 'Amerikanisch-Ozeanien', 'Amerikanisch-Samoa', 'Amerikanische Jungferninseln', 'Andorra', 'Angola', 'Anguilla', 'Antarktis', 'Antigua und Barbuda', 'Argentinien', 'Armenien', 'Aruba', 'Aserbaidschan', 'Australien', 'Ägypten', 'Äquatorialguinea', 'Äthiopien', 'Äusseres Ozeanien', + 'Bahamas', 'Bahrain', 'Bangladesch', 'Barbados', 'Belarus', 'Belgien', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivien', 'Bosnien und Herzegowina', 'Botsuana', 'Bouvetinsel', 'Brasilien', 'Britische Jungferninseln', 'Britisches Territorium im Indischen Ozean', 'Brunei Darussalam', 'Bulgarien', 'Burkina Faso', 'Burundi', + 'Chile', 'China', 'Cookinseln', 'Costa Rica', 'Côte d’Ivoire', + 'Demokratische Republik Kongo', 'Demokratische Volksrepublik Korea', 'Deutschland', 'Dominica', 'Dominikanische Republik', 'Dschibuti', 'Dänemark', + 'Ecuador', 'El Salvador', 'Eritrea', 'Estland', 'Europäische Union', + 'Falklandinseln', 'Fidschi', 'Finnland', 'Frankreich', 'Französisch-Guayana', 'Französisch-Polynesien', 'Französische Süd- und Antarktisgebiete', 'Färöer', + 'Gabun', 'Gambia', 'Georgien', 'Ghana', 'Gibraltar', 'Grenada', 'Griechenland', 'Grönland', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', + 'Haiti', 'Heard- und McDonald-Inseln', 'Honduras', + 'Indien', 'Indonesien', 'Irak', 'Iran', 'Irland', 'Island', 'Isle of Man', 'Israel', 'Italien', + 'Jamaika', 'Japan', 'Jemen', 'Jersey', 'Jordanien', + 'Kaimaninseln', 'Kambodscha', 'Kamerun', 'Kanada', 'Kap Verde', 'Kasachstan', 'Katar', 'Kenia', 'Kirgisistan', 'Kiribati', 'Kokosinseln', 'Kolumbien', 'Komoren', 'Kongo', 'Kroatien', 'Kuba', 'Kuwait', + 'Laos', 'Lesotho', 'Lettland', 'Libanon', 'Liberia', 'Libyen', 'Liechtenstein', 'Litauen', 'Luxemburg', + 'Madagaskar', 'Malawi', 'Malaysia', 'Malediven', 'Mali', 'Malta', 'Marokko', 'Marshallinseln', 'Martinique', 'Mauretanien', 'Mauritius', 'Mayotte', 'Mazedonien', 'Mexiko', 'Mikronesien', 'Monaco', 'Mongolei', 'Montenegro', 'Montserrat', 'Mosambik', 'Myanmar', + 'Namibia', 'Nauru', 'Nepal', 'Neukaledonien', 'Neuseeland', 'Nicaragua', 'Niederlande', 'Niederländische Antillen', 'Niger', 'Nigeria', 'Niue', 'Norfolkinsel', 'Norwegen', 'Nördliche Marianen', + 'Oman', 'Osttimor', 'Österreich', + 'Pakistan', 'Palau', 'Palästinensische Gebiete', 'Panama', 'Papua-Neuguinea', 'Paraguay', 'Peru', 'Philippinen', 'Pitcairn', 'Polen', 'Portugal', 'Puerto Rico', + 'Republik Korea', 'Republik Moldau', 'Ruanda', 'Rumänien', 'Russische Föderation', 'Réunion', + 'Salomonen', 'Sambia', 'Samoa', 'San Marino', 'Saudi-Arabien', 'Schweden', 'Schweiz', 'Senegal', 'Serbien', 'Serbien und Montenegro', 'Seychellen', 'Sierra Leone', 'Simbabwe', 'Singapur', 'Slowakei', 'Slowenien', 'Somalia', 'Sonderverwaltungszone Hongkong', 'Sonderverwaltungszone Macao', 'Spanien', 'Sri Lanka', 'St. Barthélemy', 'St. Helena', 'St. Kitts und Nevis', 'St. Lucia', 'St. Martin', 'St. Pierre und Miquelon', 'St. Vincent und die Grenadinen', 'Sudan', 'Suriname', 'Svalbard und Jan Mayen', 'Swasiland', 'Syrien', 'São Tomé und Príncipe', 'Südafrika', 'Südgeorgien und die Südlichen Sandwichinseln', + 'Tadschikistan', 'Taiwan', 'Tansania', 'Thailand', 'Togo', 'Tokelau', 'Tonga', 'Trinidad und Tobago', 'Tschad', 'Tschechische Republik', 'Tunesien', 'Turkmenistan', 'Turks- und Caicosinseln', 'Tuvalu', 'Türkei', + 'Uganda', 'Ukraine', 'Unbekannte oder ungültige Region', 'Ungarn', 'Uruguay', 'Usbekistan', + 'Vanuatu', 'Vatikanstadt', 'Venezuela', 'Vereinigte Arabische Emirate', 'Vereinigte Staaten', 'Vereinigtes Königreich', 'Vietnam', + 'Wallis und Futuna', 'Weihnachtsinsel', 'Westsahara', + 'Zentralafrikanische Republik', 'Zypern', + ); + + protected static $cityFormats = array( + '{{cityName}}', + ); + + protected static $streetNameFormats = array( + '{{lastName}}{{streetSuffixShort}}', + '{{cityName}}{{streetSuffixShort}}', + '{{firstName}}-{{lastName}}-{{streetSuffixLong}}' + ); + + protected static $streetAddressFormats = array( + '{{streetName}} {{buildingNumber}}', + ); + protected static $addressFormats = array( + "{{streetAddress}}\n{{postcode}} {{city}}", + ); + + public function cityName() + { + return static::randomElement(static::$cityNames); + } + + public function streetSuffixShort() + { + return static::randomElement(static::$streetSuffixShort); + } + + public function streetSuffixLong() + { + return static::randomElement(static::$streetSuffixLong); + } + + /** + * Returns a canton + * @example array('BE' => 'Bern') + * @return array + */ + public static function canton() + { + return static::randomElement(static::$canton); + } + + /** + * Returns the abbreviation of a canton. + * @return string + */ + public static function cantonShort() + { + $canton = static::canton(); + return $canton['short']; + } + + /** + * Returns the name of canton. + * @return string + */ + public static function cantonName() + { + $canton = static::canton(); + return $canton['name']; + } +} diff --git a/src/Faker/Provider/de_CH/Company.php b/src/Faker/Provider/de_CH/Company.php new file mode 100644 index 0000000000..604ec5ae8e --- /dev/null +++ b/src/Faker/Provider/de_CH/Company.php @@ -0,0 +1,15 @@ + 'AG', 'name' => 'Argovie'), array('short' => 'AI', 'name' => 'Appenzell Rhodes-Intérieures'), array('short' => 'AR', 'name' => 'Appenzell Rhodes-Extérieures'), array('short' => 'BE', 'name' => 'Berne'), array('short' => 'BL', 'name' => 'Bâle-Campagne'), array('short' => 'BS', 'name' => 'Bâle-Ville'), array('short' => 'FR', 'name' => 'Fribourg'), array('short' => 'GE', 'name' => 'Genève'), array('short' => 'GL', 'name' => 'Glaris'), array('short' => 'GR', 'name' => 'Grisons'), array('short' => 'JU', 'name' => 'Jura')), array('short' => 'LU', 'name' => 'Lucerne'), array('short' => 'NE', 'name' => 'Neuchâtel'), array('short' => 'NW', 'name' => 'Nidwald'), array('short' => 'OW', 'name' => 'Obwald'), array('short' => 'SG', 'name' => 'Saint-Gall'), array('short' => 'SH', 'name' => 'Schaffhouse'), array('short' => 'SO', 'name' => 'Soleure'), array('short' => 'SZ', 'name' => 'Schwytz'), array('short' => 'TG', 'name' => 'Thurgovie'), array('short' => 'TI', 'name' => 'Tessin'), array('short' => 'UR', 'name' => 'Uri'), array('short' => 'VD', 'name' => 'Vaud'), array('short' => 'VS', 'name' => 'Valais'), array('short' => 'ZG', 'name' => 'Zoug'), array('short' => 'ZH', 'name' => 'Zurich') + ); + + protected static $country = array( + 'Afghanistan', 'Afrique du sud', 'Albanie', 'Algérie', 'Allemagne', 'Andorre', 'Angola', 'Anguilla', 'Antarctique', 'Antigua et Barbuda', 'Antilles néerlandaises', 'Arabie saoudite', 'Argentine', 'Arménie', 'Aruba', 'Australie', 'Autriche', 'Azerbaïdjan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Belgique', 'Belize', 'Benin', 'Bermudes (Les)', 'Bhoutan', 'Biélorussie', 'Bolivie', 'Bosnie-Herzégovine', 'Botswana', 'Bouvet (Îles)', 'Brunei', 'Brésil', 'Bulgarie', 'Burkina Faso', 'Burundi', 'Cambodge', 'Cameroun', 'Canada', 'Cap Vert', 'Cayman (Îles)', 'Chili', 'Chine (Rép. pop.)', 'Christmas (Île)', 'Chypre', 'Cocos (Îles)', 'Colombie', 'Comores', 'Cook (Îles)', 'Corée du Nord', 'Corée, Sud', 'Costa Rica', 'Croatie', 'Cuba', 'Côte d\'Ivoire', 'Danemark', 'Djibouti', 'Dominique', 'Égypte', 'El Salvador', 'Émirats arabes unis', 'Équateur', 'Érythrée', 'Espagne', 'Estonie', 'États-Unis', 'Ethiopie', 'Falkland (Île)', 'Fidji (République des)', 'Finlande', 'France', 'Féroé (Îles)', 'Gabon', + 'Gambie', 'Ghana', 'Gibraltar', 'Grenade', 'Groenland', 'Grèce', 'Guadeloupe', 'Guam', 'Guatemala', 'Guinée', 'Guinée Equatoriale', 'Guinée-Bissau', 'Guyane', 'Guyane française', 'Géorgie', 'Géorgie du Sud et Sandwich du Sud (Îles)', 'Haïti', 'Heard et McDonald (Îles)', 'Honduras', 'Hong Kong', 'Hongrie', 'Îles Mineures Éloignées des États-Unis', 'Inde', 'Indonésie', 'Irak', 'Iran', 'Irlande', 'Islande', 'Israël', 'Italie', 'Jamaïque', 'Japon', 'Jordanie', 'Kazakhstan', 'Kenya', 'Kirghizistan', 'Kiribati', 'Koweit', 'La Barbad', 'Laos', 'Lesotho', 'Lettonie', 'Liban', 'Libye', 'Libéria', 'Liechtenstein', 'Lithuanie', 'Luxembourg', 'Macau', 'Macédoine', 'Madagascar', 'Malaisie', 'Malawi', 'Maldives (Îles)', 'Mali', 'Malte', 'Mariannes du Nord (Îles)', 'Maroc', 'Marshall (Îles)', 'Martinique', 'Maurice', 'Mauritanie', 'Mayotte', 'Mexique', 'Micronésie (États fédérés de)', 'Moldavie', 'Monaco', 'Mongolie', 'Montserrat', 'Mozambique', 'Myanmar', 'Namibie', 'Nauru', 'Nepal', + 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk (Îles)', 'Norvège', 'Nouvelle Calédonie', 'Nouvelle-Zélande', 'Oman', 'Ouganda', 'Ouzbékistan', 'Pakistan', 'Palau', 'Panama', 'Papouasie-Nouvelle-Guinée', 'Paraguay', 'Pays-Bas', 'Philippines', 'Pitcairn (Îles)', 'Pologne', 'Polynésie française', 'Porto Rico', 'Portugal', 'Pérou', 'Qatar', 'Roumanie', 'Royaume-Uni', 'Russie', 'Rwanda', 'Rép. Dém. du Congo', 'République centrafricaine', 'République Dominicaine', 'République tchèque', 'Réunion (La)', 'Sahara Occidental', 'Saint Pierre et Miquelon', 'Saint Vincent et les Grenadines', 'Saint-Kitts et Nevis', 'Saint-Marin (Rép. de)', 'Sainte Hélène', 'Sainte Lucie', 'Samoa', 'Samoa', 'Seychelles', 'Sierra Leone', 'Singapour', 'Slovaquie', 'Slovénie', 'Somalie', 'Soudan', 'Sri Lanka', 'Suisse', 'Suriname', 'Suède', 'Svalbard et Jan Mayen (Îles)', 'Swaziland', 'Syrie', 'São Tomé et Príncipe (Rép.)', 'Sénégal', 'Tadjikistan', 'Taiwan', 'Tanzanie', 'Tchad', + 'Territoire britannique de l\'océan Indien', 'Territoires français du sud', 'Thailande', 'Timor', 'Togo', 'Tokelau', 'Tonga', 'Trinité et Tobago', 'Tunisie', 'Turkménistan', 'Turks et Caïques (Îles)', 'Turquie', 'Tuvalu', 'Ukraine', 'Uruguay', 'Vanuatu', 'Vatican (Etat du)', 'Venezuela', 'Vierges (Îles)', 'Vierges britanniques (Îles)', 'Vietnam', 'Wallis et Futuna (Îles)', 'Yemen', 'Yougoslavie', 'Zambie', 'Zaïre', 'Zimbabwe' + ); + + protected static $cityFormats = array( + '{{cityName}}', + ); + + protected static $streetNameFormats = array( + '{{streetPrefix}} {{lastName}}', + '{{streetPrefix}} de {{cityName}}', + '{{streetPrefix}} de {{lastName}}' + ); + + protected static $streetAddressFormats = array( + '{{streetName}} {{buildingNumber}}', + ); + protected static $addressFormats = array( + "{{streetAddress}}\n{{postcode}} {{city}}", + ); + + public function cityName() + { + return static::randomElement(static::$cityNames); + } + + /** + * Returns a canton + * @example array('BE' => 'Bern') + * @return array + */ + public static function canton() + { + return static::randomElement(static::$canton); + } + + /** + * Returns the abbreviation of a canton. + * @return string + */ + public static function cantonShort() + { + $canton = static::canton(); + return $canton['short']; + } + + /** + * Returns the name of canton. + * @return string + */ + public static function cantonName() + { + $canton = static::canton(); + return $canton['name']; + } +} diff --git a/src/Faker/Provider/fr_CH/Company.php b/src/Faker/Provider/fr_CH/Company.php new file mode 100644 index 0000000000..bf3b0ae8ec --- /dev/null +++ b/src/Faker/Provider/fr_CH/Company.php @@ -0,0 +1,15 @@ + 'AG', 'name' => 'Argovia'), array('short' => 'AI', 'name' => 'Appenzello Interno'), array('short' => 'AR', 'name' => 'Appenzello Esterno'), array('short' => 'BE', 'name' => 'Berna'), array('short' => 'BL', 'name' => 'Basilea Campagna'), array('short' => 'BS', 'name' => 'Basilea Città'), array('short' => 'FR', 'name' => 'Friburgo'), array('short' => 'GE', 'name' => 'Ginevra'), array('short' => 'GL', 'name' => 'Glarona'), array('short' => 'GR', 'name' => 'Grigioni'), array('short' => 'JU', 'name' => 'Giura'), array('short' => 'LU', 'name' => 'Lucerna'), array('short' => 'NE', 'name' => 'Neuchâtel'), array('short' => 'NW', 'name' => 'Nidvaldo'), array('short' => 'OW', 'name' => 'Obvaldo'), array('short' => 'SG', 'name' => 'San Gallo'), array('short' => 'SH', 'name' => 'Sciaffusa'), array('short' => 'SO', 'name' => 'Soletta'), array('short' => 'SZ', 'name' => 'Svitto'), array('short' => 'TG', 'name' => 'Turgovia'), array('short' => 'TI', 'name' => 'Ticino'), array('short' => 'UR', 'name' => 'Uri'), array('short' => 'VD', 'name' => 'Vaud'), array('short' => 'VS', 'name' => 'Vallese'), array('short' => 'ZG', 'name' => 'Zugo'), array('short' => 'ZH', 'name' => 'Zurigo') + ); + + protected static $country = array( + 'Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antartide (territori a sud del 60° parallelo)', 'Antigua e Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', + 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Bielorussia', 'Belgio', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia e Herzegovina', 'Botswana', 'Bouvet Island (Bouvetoya)', 'Brasile', 'Territorio dell\'arcipelago indiano', 'Isole Vergini Britanniche', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', + 'Cambogia', 'Cameroon', 'Canada', 'Capo Verde', 'Isole Cayman', 'Repubblica Centrale Africana', 'Chad', 'Cile', 'Cina', 'Isola di Pasqua', 'Isola di Cocos (Keeling)', 'Colombia', 'Comoros', 'Congo', 'Isole Cook', 'Costa Rica', 'Costa d\'Avorio', 'Croazia', 'Cuba', 'Cipro', 'Repubblica Ceca', + 'Danimarca', 'Gibuti', 'Repubblica Dominicana', + 'Equador', 'Egitto', 'El Salvador', 'Guinea Equatoriale', 'Eritrea', 'Estonia', 'Etiopia', + 'Isole Faroe', 'Isole Falkland (Malvinas)', 'Fiji', 'Finlandia', 'Francia', 'Guyana Francese', 'Polinesia Francese', 'Territori Francesi del sud', + 'Gabon', 'Gambia', 'Georgia', 'Germania', 'Ghana', 'Gibilterra', 'Grecia', 'Groenlandia', 'Grenada', 'Guadalupa', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', + 'Haiti', 'Heard Island and McDonald Islands', 'Città del Vaticano', 'Honduras', 'Hong Kong', 'Ungheria', + 'Islanda', 'India', 'Indonesia', 'Iran', 'Iraq', 'Irlanda', 'Isola di Man', 'Israele', 'Italia', + 'Giamaica', 'Giappone', 'Jersey', 'Giordania', + 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea', 'Kuwait', 'Republicca Kirgiza', + 'Repubblica del Laos', 'Latvia', 'Libano', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lituania', 'Lussemburgo', + 'Macao', 'Macedonia', 'Madagascar', 'Malawi', 'Malesia', 'Maldive', 'Mali', 'Malta', 'Isole Marshall', 'Martinica', 'Mauritania', 'Mauritius', 'Mayotte', 'Messico', 'Micronesia', 'Moldova', 'Principato di Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Marocco', 'Mozambico', 'Myanmar', + 'Namibia', 'Nauru', 'Nepal', 'Antille Olandesi', 'Olanda', 'Nuova Caledonia', 'Nuova Zelanda', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Isole Norfolk', 'Northern Mariana Islands', 'Norvegia', + 'Oman', + 'Pakistan', 'Palau', 'Palestina', 'Panama', 'Papua Nuova Guinea', 'Paraguay', 'Peru', 'Filippine', 'Pitcairn Islands', 'Polonia', 'Portogallo', 'Porto Rico', + 'Qatar', + 'Reunion', 'Romania', 'Russia', 'Rwanda', + 'San Bartolomeo', 'Sant\'Elena', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Martin', 'Saint Pierre and Miquelon', 'Saint Vincent and the Grenadines', 'Samoa', 'San Marino', 'Sao Tome and Principe', 'Arabia Saudita', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovenia', 'Isole Solomon', 'Somalia', 'Sud Africa', 'Georgia del sud e South Sandwich Islands', 'Spagna', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard & Jan Mayen Islands', 'Swaziland', 'Svezia', 'Svizzera', 'Siria', + 'Taiwan', 'Tajikistan', 'Tanzania', 'Tailandia', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad e Tobago', 'Tunisia', 'Turchia', 'Turkmenistan', 'Isole di Turks and Caicos', 'Tuvalu', + 'Uganda', 'Ucraina', 'Emirati Arabi Uniti', 'Regno Unito', 'Stati Uniti d\'America', 'United States Minor Outlying Islands', 'Isole Vergini Statunitensi', 'Uruguay', 'Uzbekistan', + 'Vanuatu', 'Venezuela', 'Vietnam', + 'Wallis and Futuna', 'Western Sahara', + 'Yemen', + 'Zambia', 'Zimbabwe' + ); + + protected static $cityFormats = array( + '{{cityName}}', + ); + + protected static $streetNameFormats = array( + '{{streetSuffix}} {{firstName}}', + '{{streetSuffix}} {{lastName}}' + ); + + protected static $streetAddressFormats = array( + '{{streetName}} {{buildingNumber}}', + ); + protected static $addressFormats = array( + "{{streetAddress}}\n{{postcode}} {{city}}", + ); + + public function cityName() + { + return static::randomElement(static::$cityNames); + } + + /** + * Returns a canton + * @example array('BE' => 'Bern') + * @return array + */ + public static function canton() + { + return static::randomElement(static::$canton); + } + + /** + * Returns the abbreviation of a canton. + * @return string + */ + public static function cantonShort() + { + $canton = static::canton(); + return $canton['short']; + } + + /** + * Returns the name of canton. + * @return string + */ + public static function cantonName() + { + $canton = static::canton(); + return $canton['name']; + } +} diff --git a/src/Faker/Provider/it_CH/Company.php b/src/Faker/Provider/it_CH/Company.php new file mode 100644 index 0000000000..9a42b1c3f2 --- /dev/null +++ b/src/Faker/Provider/it_CH/Company.php @@ -0,0 +1,15 @@ +addProvider(new Address($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function canton () + { + $canton = $this->faker->canton(); + $this->assertInternalType('array', $canton); + $this->assertArrayHasKey('short', $canton);; + $this->assertArrayHasKey('name', $canton); + } + + /** + * @test + */ + public function cantonName () + { + $cantonName = $this->faker->cantonName(); + $this->assertInternalType('string', $cantonName); + $this->assertGreaterThan(2, strlen($cantonName)); + } + + /** + * @test + */ + public function cantonShort () + { + $cantonShort = $this->faker->cantonShort(); + $this->assertInternalType('string', $cantonShort); + $this->assertEquals(2, strlen($cantonShort)); + } +} diff --git a/test/Faker/Provider/de_CH/InternetTest.php b/test/Faker/Provider/de_CH/InternetTest.php new file mode 100644 index 0000000000..907af21036 --- /dev/null +++ b/test/Faker/Provider/de_CH/InternetTest.php @@ -0,0 +1,35 @@ +addProvider(new Person($faker)); + $faker->addProvider(new Internet($faker)); + $faker->addProvider(new Company($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function emailIsValid() + { + $email = $this->faker->email(); + $this->assertNotFalse(filter_var($email, FILTER_VALIDATE_EMAIL)); + } +} diff --git a/test/Faker/Provider/de_CH/PhoneNumberTest.php b/test/Faker/Provider/de_CH/PhoneNumberTest.php new file mode 100644 index 0000000000..a5c117fcbb --- /dev/null +++ b/test/Faker/Provider/de_CH/PhoneNumberTest.php @@ -0,0 +1,36 @@ +addProvider(new PhoneNumber($faker)); + $this->faker = $faker; + } + + /** + * @test + * @dataProvider phoneNumberFormatProvider + */ + public function phoneNumberFormat() + { + $number = $this->faker->phoneNumber; + $this->assertRegExp('/^0\d{2} ?\d{3} ?\d{2} ?\d{2}|\+44 ?(\(0\))?\d{2} ?\d{3} ?\d{2} ?\d{2}$/', $number); + } + + public function phoneNumberFormatProvider (){ + return array(array(), array(), array(), array(), array(), array(), array(), array(), array(), array()); + } +} diff --git a/test/Faker/Provider/fr_CH/AddressTest.php b/test/Faker/Provider/fr_CH/AddressTest.php new file mode 100644 index 0000000000..43a5a1ba55 --- /dev/null +++ b/test/Faker/Provider/fr_CH/AddressTest.php @@ -0,0 +1,53 @@ +addProvider(new Address($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function canton () + { + $canton = $this->faker->canton(); + $this->assertInternalType('array', $canton); + $this->assertArrayHasKey('short', $canton);; + $this->assertArrayHasKey('name', $canton); + } + + /** + * @test + */ + public function cantonName () + { + $cantonName = $this->faker->cantonName(); + $this->assertInternalType('string', $cantonName); + $this->assertGreaterThan(2, strlen($cantonName)); + } + + /** + * @test + */ + public function cantonShort () + { + $cantonShort = $this->faker->cantonShort(); + $this->assertInternalType('string', $cantonShort); + $this->assertEquals(2, strlen($cantonShort)); + } +} diff --git a/test/Faker/Provider/fr_CH/InternetTest.php b/test/Faker/Provider/fr_CH/InternetTest.php new file mode 100644 index 0000000000..2f20871a70 --- /dev/null +++ b/test/Faker/Provider/fr_CH/InternetTest.php @@ -0,0 +1,35 @@ +addProvider(new Person($faker)); + $faker->addProvider(new Internet($faker)); + $faker->addProvider(new Company($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function emailIsValid() + { + $email = $this->faker->email(); + $this->assertNotFalse(filter_var($email, FILTER_VALIDATE_EMAIL)); + } +} diff --git a/test/Faker/Provider/fr_CH/PhoneNumberTest.php b/test/Faker/Provider/fr_CH/PhoneNumberTest.php new file mode 100644 index 0000000000..9ae67dd94d --- /dev/null +++ b/test/Faker/Provider/fr_CH/PhoneNumberTest.php @@ -0,0 +1,36 @@ +addProvider(new PhoneNumber($faker)); + $this->faker = $faker; + } + + /** + * @test + * @dataProvider phoneNumberFormatProvider + */ + public function phoneNumberFormat() + { + $number = $this->faker->phoneNumber; + $this->assertRegExp('/^0\d{2} ?\d{3} ?\d{2} ?\d{2}|\+44 ?(\(0\))?\d{2} ?\d{3} ?\d{2} ?\d{2}$/', $number); + } + + public function phoneNumberFormatProvider (){ + return array(array(), array(), array(), array(), array(), array(), array(), array(), array(), array()); + } +} diff --git a/test/Faker/Provider/it_CH/AddressTest.php b/test/Faker/Provider/it_CH/AddressTest.php new file mode 100644 index 0000000000..59d25c8753 --- /dev/null +++ b/test/Faker/Provider/it_CH/AddressTest.php @@ -0,0 +1,53 @@ +addProvider(new Address($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function canton () + { + $canton = $this->faker->canton(); + $this->assertInternalType('array', $canton); + $this->assertArrayHasKey('short', $canton);; + $this->assertArrayHasKey('name', $canton); + } + + /** + * @test + */ + public function cantonName () + { + $cantonName = $this->faker->cantonName(); + $this->assertInternalType('string', $cantonName); + $this->assertGreaterThan(2, strlen($cantonName)); + } + + /** + * @test + */ + public function cantonShort () + { + $cantonShort = $this->faker->cantonShort(); + $this->assertInternalType('string', $cantonShort); + $this->assertEquals(2, strlen($cantonShort)); + } +} diff --git a/test/Faker/Provider/it_CH/InternetTest.php b/test/Faker/Provider/it_CH/InternetTest.php new file mode 100644 index 0000000000..16616c70c5 --- /dev/null +++ b/test/Faker/Provider/it_CH/InternetTest.php @@ -0,0 +1,35 @@ +addProvider(new Person($faker)); + $faker->addProvider(new Internet($faker)); + $faker->addProvider(new Company($faker)); + $this->faker = $faker; + } + + /** + * @test + */ + public function emailIsValid() + { + $email = $this->faker->email(); + $this->assertNotFalse(filter_var($email, FILTER_VALIDATE_EMAIL)); + } +} diff --git a/test/Faker/Provider/it_CH/PhoneNumberTest.php b/test/Faker/Provider/it_CH/PhoneNumberTest.php new file mode 100644 index 0000000000..1638a91ac7 --- /dev/null +++ b/test/Faker/Provider/it_CH/PhoneNumberTest.php @@ -0,0 +1,36 @@ +addProvider(new PhoneNumber($faker)); + $this->faker = $faker; + } + + /** + * @test + * @dataProvider phoneNumberFormatProvider + */ + public function phoneNumberFormat() + { + $number = $this->faker->phoneNumber; + $this->assertRegExp('/^0\d{2} ?\d{3} ?\d{2} ?\d{2}|\+44 ?(\(0\))?\d{2} ?\d{3} ?\d{2} ?\d{2}$/', $number); + } + + public function phoneNumberFormatProvider (){ + return array(array(), array(), array(), array(), array(), array(), array(), array(), array(), array()); + } +}