1234567891011121314151617181920212223242526 |
- <?php
- namespace Faker\Test\Provider\pt_PT;
- use Faker\Generator;
- use Faker\Provider\pt_PT\PhoneNumber;
- class PhoneNumberTest extends \PHPUnit_Framework_TestCase
- {
- public function setUp()
- {
- $faker = new Generator();
- $faker->addProvider(new PhoneNumber($faker));
- $this->faker = $faker;
- }
- public function testPhoneNumberReturnsPhoneNumberWithOrWithoutPrefix()
- {
- $this->assertRegExp('/^(9[1,2,3,6][0-9]{7})|(2[0-9]{8})|(\+351 [2][0-9]{8})|(\+351 9[1,2,3,6][0-9]{7})/', $this->faker->phoneNumber());
- }
- public function testMobileNumberReturnsMobileNumberWithOrWithoutPrefix()
- {
- $this->assertRegExp('/^(9[1,2,3,6][0-9]{7})/', $this->faker->mobileNumber());
- }
- }
|