LocalizationTest.php 1.0 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Faker\Test\Provider;
  3. use Faker\Factory;
  4. use PHPUnit\Framework\TestCase;
  5. class LocalizationTest extends TestCase
  6. {
  7. public function testLocalizedNameProvidersDoNotThrowErrors()
  8. {
  9. foreach (glob(__DIR__ . '/../../../src/Faker/Provider/*/Person.php') as $localizedPerson) {
  10. preg_match('#/([a-zA-Z_]+)/Person\.php#', $localizedPerson, $matches);
  11. $faker = Factory::create($matches[1]);
  12. $this->assertNotNull($faker->name(), 'Localized Name Provider ' . $matches[1] . ' does not throw errors');
  13. }
  14. }
  15. public function testLocalizedAddressProvidersDoNotThrowErrors()
  16. {
  17. foreach (glob(__DIR__ . '/../../../src/Faker/Provider/*/Address.php') as $localizedAddress) {
  18. preg_match('#/([a-zA-Z_]+)/Address\.php#', $localizedAddress, $matches);
  19. $faker = Factory::create($matches[1]);
  20. $this->assertNotNull($faker->address(), 'Localized Address Provider ' . $matches[1] . ' does not throw errors');
  21. }
  22. }
  23. }