菜谱项目

AddressTest.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Faker\Provider\ng_NG;
  3. use Faker\Generator;
  4. use Faker\Provider\en_NG\Address;
  5. class AddressTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var Generator
  9. */
  10. private $faker;
  11. public function setUp()
  12. {
  13. $faker = new Generator();
  14. $faker->addProvider(new Address($faker));
  15. $this->faker = $faker;
  16. }
  17. /**
  18. *
  19. */
  20. public function testPostcodeIsNotEmptyAndIsValid()
  21. {
  22. $postcode = $this->faker->postcode();
  23. $this->assertNotEmpty($postcode);
  24. $this->assertInternalType('string', $postcode);
  25. }
  26. /**
  27. * Test the name of the Nigerian State/County
  28. */
  29. public function testCountyIsAValidString()
  30. {
  31. $county = $this->faker->county;
  32. $this->assertNotEmpty($county);
  33. $this->assertInternalType('string', $county);
  34. }
  35. /**
  36. * Test the name of the Nigerian Region in a State.
  37. */
  38. public function testRegionIsAValidString()
  39. {
  40. $region = $this->faker->region;
  41. $this->assertNotEmpty($region);
  42. $this->assertInternalType('string', $region);
  43. }
  44. }