AddressTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace Faker\Provider\ng_NG;
  3. use Faker\Generator;
  4. use Faker\Provider\en_NG\Address;
  5. use PHPUnit\Framework\TestCase;
  6. class AddressTest extends TestCase
  7. {
  8. /**
  9. * @var 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. /**
  19. *
  20. */
  21. public function testPostcodeIsNotEmptyAndIsValid()
  22. {
  23. $postcode = $this->faker->postcode();
  24. $this->assertNotEmpty($postcode);
  25. $this->assertInternalType('string', $postcode);
  26. }
  27. /**
  28. * Test the name of the Nigerian State/County
  29. */
  30. public function testCountyIsAValidString()
  31. {
  32. $county = $this->faker->county;
  33. $this->assertNotEmpty($county);
  34. $this->assertInternalType('string', $county);
  35. }
  36. /**
  37. * Test the name of the Nigerian Region in a State.
  38. */
  39. public function testRegionIsAValidString()
  40. {
  41. $region = $this->faker->region;
  42. $this->assertNotEmpty($region);
  43. $this->assertInternalType('string', $region);
  44. }
  45. }