addProvider(new PhoneNumber($faker)); $this->faker = $faker; } public function testPhoneNumberFormat() { $number = $this->faker->phoneNumber; $this->assertRegExp('/^06\d{2} \d{7}|\+43 \d{4} \d{4}(-\d{2})?$/', $number); } }