Skip to content

Add Drupal config value assertion steps #676

Description

@AlexSkrypnyk

Summary

Add steps to assert (and set) a stored Drupal configuration value.

Details

ConfigOverrideTrait only disables settings.php overrides; there is no way to assert a stored Drupal configuration value. Add steps to assert that a config object's key holds an expected value, assert containment for nested/array values, and set a config value for setup. This is a frequent need when testing that a feature toggle, a third-party API endpoint, or a site setting is configured as expected, and it currently forces testers to drop out of Gherkin into custom PHP.

Proposed steps

  • Assert that a config object's key equals an expected value.
  • Assert that a config object's key contains an expected value (nested/array-aware).
  • Set a config object's key to a value for test setup.

Acceptance criteria

  • New trait, or steps in a suitable Drupal trait, under src/Drupal/.
  • Reads via the Drupal config factory; writes via editable config, restored after the scenario where practical.
  • Nested keys addressable with dotted notation.
  • Steps use the tuple format with the Assert prefix on assertions.
  • BDD coverage for equals, contains, and set.
  • STEPS.md regenerated via ahoy update-docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions