Issue #3257306: Add a detailed module documentation & Create content_fixtures_example module
📘 Documentation
In the README.md I have created an easy to follow documentation similar to DoctrineFixturesBundle but more specific to Drupal, the easier the module to understand the more people will like to use it
-
✅ Creating and loading fixtures. -
✅ Sharing objects between fixtures. -
✅ Loading the Fixture Files in Specific Order using the 2 ways (order & dependency). -
✅ Using Fixture Groups. -
✅ ...
Also, the document starts with a reference that contains a link to each section, so if a developer searches for a specific task no need to search the whole doc he can jump to that section.
🔥 content_fixtures_example module
the README.md documentation contains some reference to these classes to make a developer able to see a real example and better understand the documentation:
-
✅ /modules/content_fixtures_example/src/Fixture/ArticleFixture: a basic example to create a set of article fixtures using a for loop. -
✅ /modules/content_fixtures_example/src/Fixture/groups: Contains 2 fixtures that belongs to the same group . -
✅ /modules/content_fixtures_example/src/Fixture/splitting_fixtures: Contain 2 classesUserFixture
will create a new user object then it will share it with all other fixtures, then theNodeFixture
will access the to the created user object and assign to the new node, and I have used thegetDependencies()
to make sure theNodeFixture
loaded before theUserFixture
(execution order).
Edited by Marwen Amri