1234567891011121314151617181920212223242526 |
- <?php
- namespace Faker\Test\Provider\ng_NG;
- use Faker\Generator;
- use Faker\Provider\en_NG\PhoneNumber;
- class PhoneNumberTest extends \PHPUnit_Framework_TestCase
- {
- public function setUp()
- {
- $faker = new Generator();
- $faker->addProvider(new PhoneNumber($faker));
- $this->faker = $faker;
- }
- public function testPhoneNumberReturnsPhoneNumberWithOrWithoutCountryCode()
- {
- $phoneNumber = $this->faker->phoneNumber();
- $this->assertNotEmpty($phoneNumber);
- $this->assertInternalType('string', $phoneNumber);
- $this->assertRegExp('/^(0|(\+234))\s?[789][01]\d\s?(\d{3}\s?\d{4})/', $phoneNumber);
- }
- }
|