Recently I talked about my favourite n98-magerun commands, this time I’ll continue that topic. Let’s see how to easily add a lot of customers to a Magento store. Of course it’s about adding fake data for testing purposes, unfortunately n98-magerun doesn’t help in bringing real ones :-)
Command customer:create:dummy allows you to create dummy customer accounts for testing purposes. It supports a few different locales and allows to generate any amount of accounts.
$ n98-magerun.phar customer:create:dummy 1000 pl_PL
[…]
Please select a website: 1
It took about 13 minutes to create 1000 customers, so it is able to fill a database with thousands of customers in a few hours. Sample output looks as follows:
Customer wieczorek.julia.152196@example.org with password QAELhMP! successfully created
Customer fabian.291162@example.net with password 8grCBZ9$ successfully created
Customer emil.108200@example.com with password ARWRJALy successfully created
[…]
Internally it uses https://github.com/fzaninotto/Faker. That library allows it to generate other assets like texts (either lorem ipsum or more real ones), addresses, phone numbers, companies, date and times, internet accounts, payment data and a few others.
I would love to see the ability to generate products using Faker and have a few more dummy methods incorporated into n98-magerun. The ability to generate products, customer addresses, maybe sales data would be great. However, the ability to generate fake customer accounts helps a lot and it’s a great start.
Leave a Reply