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()); } }