菜谱项目

AddressTest.php 923B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace Faker\Test\Provider\en_UG;
  3. use Faker\Generator;
  4. use Faker\Provider\en_UG\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. /**
  18. * @test
  19. */
  20. public function testCityName()
  21. {
  22. $city = $this->faker->cityName();
  23. $this->assertNotEmpty($city);
  24. $this->assertInternalType('string', $city);
  25. }
  26. /**
  27. * @test
  28. */
  29. public function testDistrict()
  30. {
  31. $district = $this->faker->district();
  32. $this->assertNotEmpty($district);
  33. $this->assertInternalType('string', $district);
  34. }
  35. /**
  36. * @test
  37. */
  38. public function testRegion()
  39. {
  40. $region = $this->faker->region();
  41. $this->assertNotEmpty($region);
  42. $this->assertInternaltype('string', $region);
  43. }
  44. }