AddressTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Faker\Provider\en_AU;
  3. use Faker\Generator;
  4. use Faker\Provider\en_AU\Address;
  5. use PHPUnit\Framework\TestCase;
  6. class AddressTest extends TestCase
  7. {
  8. /**
  9. * @var Faker\Generator
  10. */
  11. private $faker;
  12. public function setUp()
  13. {
  14. $faker = new Generator();
  15. $faker->addProvider(new Address($faker));
  16. $this->faker = $faker;
  17. }
  18. public function testCityPrefix()
  19. {
  20. $cityPrefix = $this->faker->cityPrefix();
  21. $this->assertNotEmpty($cityPrefix);
  22. $this->assertInternalType('string', $cityPrefix);
  23. $this->assertRegExp('/[A-Z][a-z]+/', $cityPrefix);
  24. }
  25. public function testStreetSuffix()
  26. {
  27. $streetSuffix = $this->faker->streetSuffix();
  28. $this->assertNotEmpty($streetSuffix);
  29. $this->assertInternalType('string', $streetSuffix);
  30. $this->assertRegExp('/[A-Z][a-z]+/', $streetSuffix);
  31. }
  32. public function testState()
  33. {
  34. $state = $this->faker->state();
  35. $this->assertNotEmpty($state);
  36. $this->assertInternalType('string', $state);
  37. $this->assertRegExp('/[A-Z][a-z]+/', $state);
  38. }
  39. }
  40. ?>