菜谱项目

AddressTest.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Faker\Test\Provider\en_PH;
  3. use Faker\Generator;
  4. use Faker\Provider\en_PH\Address;
  5. class AddressTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var Faker\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. public function testProvince()
  18. {
  19. $province = $this->faker->province();
  20. $this->assertNotEmpty($province);
  21. $this->assertInternalType('string', $province);
  22. }
  23. public function testCity()
  24. {
  25. $city = $this->faker->city();
  26. $this->assertNotEmpty($city);
  27. $this->assertInternalType('string', $city);
  28. }
  29. public function testMunicipality()
  30. {
  31. $municipality = $this->faker->municipality();
  32. $this->assertNotEmpty($municipality);
  33. $this->assertInternalType('string', $municipality);
  34. }
  35. public function testBarangay()
  36. {
  37. $barangay = $this->faker->barangay();
  38. $this->assertInternalType('string', $barangay);
  39. }
  40. }