菜谱项目

PhoneNumberTest.php 530B

12345678910111213141516171819202122
  1. <?php
  2. namespace Faker\Test\Provider\ja_JP;
  3. use Faker\Generator;
  4. use Faker\Provider\ja_JP\PhoneNumber;
  5. class PhoneNumberTest extends \PHPUnit_Framework_TestCase
  6. {
  7. public function testPhoneNumber()
  8. {
  9. $faker = new Generator();
  10. $faker->addProvider(new PhoneNumber($faker));
  11. for ($i = 0; $i < 10; $i++) {
  12. $phoneNumber = $faker->phoneNumber;
  13. $this->assertNotEmpty($phoneNumber);
  14. $this->assertRegExp('/^0\d{1,4}-\d{1,4}-\d{3,4}$/', $phoneNumber);
  15. }
  16. }
  17. }