Setting up similar factories with Laracasts/TestDummy

I’ve been using laracasts/Testdummy a lot recently which is a great tool for setting up any testing you’re doing. It auto-generates your Laravel 5 models with faker data.

However, sometimes when you’re setting up a very similar named model it becomes laborious copying and pasting the same things across multiple instances with the same default data.

So here’s my super easy “pattern” so you’re not creating too much. All it relies on is using the array_merge to overwrite the default set.

Leave a Reply


You are commenting using your account. Log Out /  Change )

Google photo


Twitter picture


Facebook photo


Connecting to %s