Download the PHP package marty/mcfly without Composer
On this page you can find all versions of the php package marty/mcfly. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package mcfly
Short Description Marty McFly - Back to the Future to write your Symfony fixtures
License MIT
Homepage https://www.wixiweb.fr
Informations about the package mcfly
Marty MacFly
Marty MacFly - Back to the Future to write your Symfony fixtures Marty MacFly allows you to quickly and easily create fixtures to simplify development and testing for Symfony.
Main features
Installing
PHP 8.0+ and Composer are required.
You need to create a fixture file per entity and extend Marty\McFly\Fixture
instead of Doctrine\Bundle\FixturesBundle\Fixture
.
By adding Marty\McFly\Fixture
, you must adhere to the Marty\McFly\Interface\CreateInterface
interface and add a generate()
function.
⚠️ The
create()
function was renamed togenerate()
between v1 and v2 to avoid breaking changes. Thecreate()
function is still compatible but it is recommended to migrate togenerate()
to benefit from the new features.
Configure your template (generate()
is a factory, work with Reflection without setters or _construct)
Configure your template : The alternative style (using setter if you have) :
Usage
Create a random entity
Creating an entity by setting only the necessary properties (recommandation style).
Creating an entity by setting only the necessary properties (alternative style).
⚠️ With this syntax, the entity is create and change after.
Create multiple entities while customizing certain properties.
Create multiple entities while customizing certain properties with random values for each element.
Create multiple entities while customizing certain properties (alternative.
Dependencies
References, counter, enum an random values
Credits
- Arnaud Lemercier is based on Wixiweb.
License
Marty MacFly is licensed under The MIT License (MIT).