1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 00:09:59 +01:00

Merge pull request #110 from csanquer/feature_safe_email_domain

adding a safe email domain generator method
This commit is contained in:
Francois Zaninotto 2013-02-11 05:47:46 -08:00
commit fe9c56fa5b
2 changed files with 10 additions and 2 deletions

View File

@ -114,6 +114,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
freeEmail // 'bradley72@gmail.com'
companyEmail // 'russel.durward@mcdermott.org'
freeEmailDomain // 'yahoo.com'
safeEmailDomain // 'example.org'
userName // 'wade55'
domainName // 'wolffdeckow.net'
domainWord // 'feeney'

View File

@ -38,7 +38,7 @@ class Internet extends \Faker\Provider\Base
*/
public function safeEmail()
{
return preg_replace('/\s/', '', $this->userName() . '@example.' . static::randomElement(static::$safeEmailTld));
return preg_replace('/\s/', '', $this->userName() . '@' . static::safeEmailDomain());
}
/**
@ -64,7 +64,14 @@ class Internet extends \Faker\Provider\Base
{
return static::randomElement(static::$freeEmailDomain);
}
/**
* @example 'example.org'
*/
public static function safeEmailDomain()
{
return 'example.' . static::randomElement(static::$safeEmailTld);
}
/**
* @example 'jdoe'
*/