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

Make fake emails use free email domains from time to time

This commit is contained in:
Francois Zaninotto 2012-04-14 21:00:50 +02:00
parent b5859dc870
commit bc9fb6566a
2 changed files with 10 additions and 0 deletions

View File

@ -110,6 +110,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
email // 'tkshlerin@collins.com'
safeEmail // 'king.alford@example.org'
freeEmail // 'bradley72@gmail.com'
companyEmail // 'russel.durward@mcdermott.org'
freeEmailDomain // 'yahoo.com'
userName // 'wade55'
domainName // 'wolffdeckow.net'

View File

@ -16,6 +16,7 @@ class Internet extends \Faker\Provider\Base
);
protected static $emailFormats = array(
'{{userName}}@{{domainName}}',
'{{userName}}@{{freeEmailDomain}}',
);
protected static $urlFormats = array(
'http://www.{{domainName}}/',
@ -47,6 +48,14 @@ class Internet extends \Faker\Provider\Base
return $this->userName() . '@' . static::freeEmailDomain();
}
/**
* @example 'jdoe@dawson.com'
*/
public function companyEmail()
{
return $this->userName() . '@' . $this->domainName();
}
/**
* @example 'gmail.com'
*/