aibdd.auto.php.it.handlers.aggregate-given

Create initial aggregate states for Given steps using WordPress factories and repositories.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/zenbuapps/zenbu-powers --skill aibdd-auto-php-it-handlers-aggregate-given
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aibdd.auto.php.it.handlers.aggregate-given
Source: https://github.com/zenbuapps/zenbu-powers/tree/main/skills/aibdd.auto.php.it.handlers.aggregate-given
Command: npx skills add https://github.com/zenbuapps/zenbu-powers --skill aibdd-auto-php-it-handlers-aggregate-given

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This handler provides a reference implementation to initialize the aggregate's initial state during Given steps in AIBDD tests for WordPress-based data setups. It ensures deterministic preconditions by creating required entities and persisting them via the WP Factory Methods and a repository layer, while capturing natural keys for later steps.

Core Features & Use Cases

  • Initial state creation for aggregates in Given steps
  • Uses WP Factory Methods and Repository.save() to persist data
  • Maps natural keys to IDs for later steps
  • Supports DataTables and multi-entity relationships

Quick Start

Describe the initial aggregate state with a Given sentence and persist it using WP Factory Methods and Repository.save().

Frequently Asked Questions about aibdd.auto.php.it.handlers.aggregate-given

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up initial aggregate state for Given steps in WordPress BDD tests?

Creating initial aggregate state for Given steps involves building required entities and persisting them via WP Factory Methods and Repository.save(). This handler maps natural keys to IDs, ensuring deterministic preconditions and supporting DataTables for multi-entity relationships in WordPress BDD tests.

What is the best way to persist test data using WordPress factory methods in BDD scenarios?

The best way to persist test data using WordPress factory methods in BDD scenarios is to apply Repository.save() after entity creation. This approach ensures deterministic state creation by mapping natural keys to generated IDs for reliable subsequent test step references.

Can I use DataTables to create multiple related entities in WordPress test repositories?

Yes, you can use DataTables to create multiple related entities in WordPress test repositories. The aggregate state handler supports DataTables and multi-entity relationships, allowing you to define complex pre-existing data structures and persist them via the repository layer.

Why do I need natural key mapping when setting up WordPress test data for BDD steps?

You need natural key mapping when setting up WordPress test data for BDD steps to capture and link generated entity IDs back to readable keys. This ensures later Then and When steps can reliably reference the correct pre-existing aggregate state without hardcoding database identifiers.

Does this Given step handler work without existing WordPress repository dependencies?

No, this Given step handler relies on an existing repository layer and WP Factory Methods to persist data. You must have the WordPress test environment and repository infrastructure configured before using it to initialize aggregate states and save entities.