{"repo":"ergebnis/factory-bot","free":true,"listed":false,"github":"https://github.com/ergebnis/factory-bot","clone":"git clone https://github.com/ergebnis/factory-bot.git","description":"🤖 Provides a composer package with a fixture factory for doctrine/orm entities.","language":"PHP","stars":81,"topics":["doctrine","entity","factory","orm","fixture"],"license":"MIT","category":"databases-storage","readme_excerpt":"factory-bot This project provides a composer package with a fixture factory for doctrine/orm entities. Installation Run Usage The entry point of ergebnis/factory-bot is the FixtureFactory . You will use the fixture factory to create entity definitions and to create Doctrine entities populated with fake data. - Examples - Creating a fixture factory - Creating entity definitions - Loading entity definitions - Registering entity definitions - Creating entities - Persisting entities - Flushing entities Examples You can find examples in - the directory example/ - the repository ergebnis/factory-bot-example Creating a fixture factory The fixture factory requires an instance of Doctrine\\ORM\\EntityManagerInterface (for reading class metadata from Doctrine entities, and for persisting Doctrine entities when necessary) and an instance of Faker\\Generator for generating fake data. To simplify the creation of a fixture factory in tests, you can create an abstract test case with access to an entity manager, a faker, and a fixture factory. Creating entity definitions Now that you have access to a fixture factory, you can create definitions for Doctrine entities. This simple definition might work when all entity fields have default values, but typically, you will want to provide a map of entity field names to field definitions. In addition to the map of field names to field definitions, you can specify a closure that the fixture factory will invoke after creating the entity. The closure acce","default_branch":null,"files":null,"tree":[],"storefront":"/r/ergebnis","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ergebnis/factory-bot/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}