You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Faker there are some column guessers like this one and this, their purpose is to help user to avoid manual matching attribute names on correct providers, because in most cases username or email in table or other storage means simple user name and email that is userName and email providers in Faker.
In this way it would be great if we will implement such functionality for generating templates based on some tables or mongo collections or other storages. So overall usage of command is :
//generate fixture template for users table, basing on some guessing mechanism
php yii fixture/template users
and if for example users table contains email / username / first_name / last_name and other, the resulting fixture template file will be like this :
//keys are attributes names, while values are anonymous functions or faker provider method namesreturn [
'username' => 'userName',
'first_name' => 'firstName',
'email' => 'email',
'last_name' => 'lastName'
];
Overall what we achive :
more automating generation in testing to help user;
we can implement different guessing strategies;
we can implement different storages that provides metadata for particular fixture template (it can be users table, or users collection in mongo, or some data in redis).
This issue has originally been reported by @Ragazzo at yiisoft/yii2#4056.
Moved here by @cebe.
In the
Faker
there are some column guessers like this one and this, their purpose is to help user to avoid manual matching attribute names on correct providers, because in most casesusername
oremail
in table or other storage means simple user name and email that isuserName
andemail
providers inFaker
.In this way it would be great if we will implement such functionality for generating templates based on some tables or mongo collections or other storages. So overall usage of command is :
//generate fixture template for users table, basing on some guessing mechanism php yii fixture/template users
and if for example
users
table containsemail
/username
/first_name
/last_name
and other, the resulting fixture template file will be like this :Overall what we achive :
users
table, orusers
collection in mongo, or some data in redis).What is your thoughts @samdark @qiangxue @cebe @klimov-paul ?
The text was updated successfully, but these errors were encountered: