laracasts/TestDummy — pull request #53 by dwightwatson (2014-12-20 11:55:49+00:00)
Title: Add attributesFor method

I've added the `attributesFor()` method, a name I've taken from FactoryGirl in the Ruby world (which also carries the `build` and `create` methods), though you might prefer just `attributes()` or `getAttributes()`.

This simply returns an array of data that would be used to populate an entity, which can be really useful for testing forms. You can easily pass the attributes through a request in one of your controller tests.

Also, sure you could go `Factory::build('Foo')->toArray()` but that's more verbose and requires hitting a database provider which really isn't necessary for just getting entity attributes. Would be a lot nicer to keep it simple!