Supplying arguments
Fixture definitions can optionally receive arguments. If you'd like to use arguments for your definition you have to explicitly type them.
Arguments will be available by accessing the second argument of the create
function you must implement.
Once you have defined your arguments you'll be required to supply them when executing the fixture.
In the above example we are required to pass the author when consuming the
postFixture
. Fluse will automatically determine if arguments are required or not.
While creating an inline entity is perfectly valid. Fluse also supports nesting fixtures. If we had a fixture definition for creating a user we could re-write the above to:
Fixtures defined by Fluse will be automatically augmented to accept other fixtures as their input arguments. Fluse will unwrap these fixtures for you so you don't have to worry about execution order.