thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
531 stars 72 forks source link

Allow to use optional modifier with factory #401

Closed localheinz closed 8 years ago

localheinz commented 8 years ago

This currently fails:

$factory->define(Model_Contest::class, [
    'sponsor_id' => 'optional:factory|' . Model_Contest_Sponsor::class,
]);

SQL ends up trying to insert the value optional:factory into the sponsor_id column. This has been observed with 84e9807.

:information_desk_person: Can we make the optional modifier work with factories?

GrahamCampbell commented 8 years ago

3.x is now the only currently maintained series for anything but important fixes and security fixes.

GrahamCampbell commented 8 years ago

Thanks for your interest though.