Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Drupal Data Fixtures module

The fixtures module allows you to easily create dummy content.

Requirements:

  • drush

Installation

  • Install and enable the module
  • Implement a Generator interface (see Basic concepts for more info)
  • run drush fixtures-load inside a working drupal installation

Road Map

  • User interface for all available commands
  • Run only a certain set of generators

Disclaimer

This module was built with a certain workflow in mind. It might work well for you. It might not. Feel free to open any issues if you feel it missing features.

This module **is not** production ready. It will never be this. It is intended for **local development only**. Optionally, you can use it to create working test-environments on the fly with dummy content.

Basic concepts

Each module defining an Entity, ConfigEntity, custom structure, ... that relies on Content to be testable (e.g. an entity bundle, menu items, ...) can also define Generators.
These generators will run by this module to automatically create a working Drupal environment from scratch.

This is epscially useful if your CI/CD workflow includes creating entirely new environments on the fly without any existing content.
This can be due to contract limitations, privacy-related data like e.g. user accounts or the fact that it is still under development.

We also found it is useful when having a team consisting of "Drupal developers" working together with Front-end developers.
When defining content types, user profiles, custom entities, ... we also provide Generators that generate content for these structures.
This way, a front-end developer does not have to manually create content every time he works on a new feature.

When not to use it

Moving content between environments: Data fixtures is based on the idea we can simply Truncate the db if needed.
Deploying real content to production: Data fixtures is based on random data. Let's keep it that way

Generators

Each Generators needs to implement the Drupal\data_fixtures\Interfaces\Generator interface.
It has 2 methods: load and unload.

To register a Generator, add it to your services.yml file and tag it with "data_fixtures"

tags:
    - { name: data_fixtures }

Available commands:

  • drush fixtures-load -> runs the load method on all Generators.
  • drush fixtures-unload -> runs the unload method on all Generators.
  • drush fixtures-reload -> runs fixtures-unload and fixtures-load, in that order.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
8.x-1.10 Stable Dec 31, 2024