I'm using Laravel's built in unit testing to test my model validations, and I'm also using Factory Muffin to generate fake data for my models.
It's working, however I'm having a really hard time finding the complete list of generators I can use to generate random data. For example, I need to generate a random string, and I can't find the name of a generator to do that. Take this as an example:
FactoryMuffin::define('User', array(
'email' => 'unique:email',
'password' => 'password',
'password_reset_code' => 'alpha_num'
));
The only thing that seems to work here is the email. Where I've defined password to be password
it uses the literal string "password"
, even though the faker library which is what actually generates the random data has a method called password
.
I've been able to get a simple list of what generators are supported by doing the following:
FactoryMuffin::getFaker();
The object returned from that has a number of methods and properties which correspond to what I can use in the define
call, however the number of methods I can use is no where near what the actual Faker library provides.
Am I missing something here?