Test infra: extract shared Scenario/Bucket persistence helpers into a trait #65

Open
opened 2026-07-05 09:08:25 +02:00 by myrmidex · 0 comments
Owner

Context

Surfaced during code review of #64. The private persistScenario() / persistBucket() helpers are now duplicated across three functional test files:

  • tests/Functional/ScenarioApiTest.php
  • tests/Functional/BucketApiTest.php
  • tests/Functional/ScenarioOwnerApiTest.php (its persistScenario takes an explicit $owner param — a legitimate variation to preserve)

Scope

Extract them into a shared trait (e.g. tests/Concerns/CreatesScenariosAndBuckets.php), mirroring the existing tests/Concerns/CreatesUsers.php pattern. Accommodate the owner-param variation (default to the caller's user, allow an explicit owner override).

Out of scope

  • Any production code change.
  • Reworking the test assertions themselves.

Notes

  • Pure test-infra refactor; the full suite must stay green (260 tests as of #64).
  • Not a blocker for anything — low priority cleanup.
## Context Surfaced during code review of #64. The private `persistScenario()` / `persistBucket()` helpers are now duplicated across three functional test files: - `tests/Functional/ScenarioApiTest.php` - `tests/Functional/BucketApiTest.php` - `tests/Functional/ScenarioOwnerApiTest.php` (its `persistScenario` takes an explicit `$owner` param — a legitimate variation to preserve) ## Scope Extract them into a shared trait (e.g. `tests/Concerns/CreatesScenariosAndBuckets.php`), mirroring the existing `tests/Concerns/CreatesUsers.php` pattern. Accommodate the owner-param variation (default to the caller's user, allow an explicit owner override). ## Out of scope - Any production code change. - Reworking the test assertions themselves. ## Notes - Pure test-infra refactor; the full suite must stay green (260 tests as of #64). - Not a blocker for anything — low priority cleanup.
myrmidex added this to the v0.3.0 milestone 2026-07-05 09:08:25 +02:00
myrmidex added the
enhancement
label 2026-07-05 09:08:25 +02:00
myrmidex self-assigned this 2026-07-05 09:08:25 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/buckets#65
No description provided.