菜谱项目

AddressTest.php 610B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Faker\Provider\pl_PL;
  3. use Faker\Generator;
  4. class AddressTest extends \PHPUnit_Framework_TestCase
  5. {
  6. /**
  7. * @var Generator
  8. */
  9. private $faker;
  10. public function setUp()
  11. {
  12. $faker = new Generator();
  13. $faker->addProvider(new Address($faker));
  14. $this->faker = $faker;
  15. }
  16. /**
  17. * Test the validity of state
  18. */
  19. public function testState()
  20. {
  21. $state = $this->faker->state();
  22. $this->assertNotEmpty($state);
  23. $this->assertInternalType('string', $state);
  24. $this->assertRegExp('/[a-z]+/', $state);
  25. }
  26. }