Mapped values
DrevOps\BehatSteps\Steps\Web\MappingTrait - Source, Example, Helpers
Replace
{{ Key }}tokens in step arguments and table cells.
- Resolve a token against the
mapping.groupsoption.- Fail the step when a key is not mapped.
Whitespace inside the braces is ignored, so
{{ Key }}and{{Key}}resolve identically. Keys are unique across groups, so the group a key was declared in does not take part in the lookup.
The transform matches the token's braces rather than a placeholder name, so 1 map covers every string argument without the step opting in.
Operates on Gherkin text alone: no Mink session and no backend, so the trait works in any suite.
Skip processing with tag:@behat-steps-skip:MappingTrait.
Options
| Option | Type | Default | Tag | Description |
|---|---|---|---|---|
mapping.enabled | boolean | TRUE | @behat-steps-skip:MappingTrait | Replace {{ Key }} tokens in step arguments and table cells. Turn it off to pass a token through to a step untouched. |
mapping.groups | map | [] | - | Named value mappings grouped for organization. Group names take no part in the lookup, so a key must be unique across all groups. |