Skip to content

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 👷 👷 👷, and like it 😃, to create these tasks just with documentation anyone can do them in few minutes 🚀, no need to search elsewhere or have pre-requirements:

  • 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 classes UserFixture will create a new user object then it will share it with all other fixtures, then the NodeFixture will access the to the created user object and assign to the new node, and I have used the getDependencies() to make sure the NodeFixture loaded before the UserFixture(execution order).
Edited by Marwen Amri

Merge request reports

Loading