菜谱项目

AddressTest.php 584B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace Faker\Test\Provider\en_SG;
  3. use Faker\Factory;
  4. use Faker\Provider\en_SG\Address;
  5. class AddressTest extends \PHPUnit_Framework_TestCase
  6. {
  7. public function setUp()
  8. {
  9. $faker = Factory::create('en_SG');
  10. $faker->addProvider(new Address($faker));
  11. $this->faker = $faker;
  12. }
  13. public function testStreetNumber()
  14. {
  15. $this->assertRegExp('/^\d{2,3}$/', $this->faker->streetNumber());
  16. }
  17. public function testBlockNumber()
  18. {
  19. $this->assertRegExp('/^Blk\s*\d{2,3}[A-H]*$/i', $this->faker->blockNumber());
  20. }
  21. }