automated tests
Closes #3581728
● All 52 tests pass (80 assertions). Here's a summary of what was created:
7 test files, all under web/modules/composer/queue_stats/test/src/Unit/:
- MonitoredQueueTest (10 tests) — verifies the decorator proxies correctly, dispatches the right events on claim/delete/release, skips events when appropriate (failed claim, failed release), and handles garbage collection conditionally.
- ProcessingRateTest (6 tests) — covers rate calculation from completion timestamps, negative rate protection for parallel processing, formatValue scaling (items/second vs items/minute), reset, and event subscriptions.
- ProcessingTimeTest (8 tests) — covers start/completion tracking per item_id, duration calculation, ignoring completions without a start, zero-duration protection, independent tracking of multiple concurrent items, date formatting delegation, and reset.
- QueueTimeTest (6 tests) — covers wait time calculation from item->created, EMA averaging across multiple items, date formatting, and reset.
- EstimatedTimeToFinishTest (5 tests) — covers the numberOfItems / processingRate calculation, division-by-zero guard, empty queue case, and date formatting.
- QueueItemEventTest (2 tests) — verifies constructor/getter round-trip and event constant string values.
- NumItemsTest (4 tests) — covers getValue delegation, getLabel, formatValue passthrough, and no-op reset.
Plus the existing ExponentialMovingAverageTest (4 tests) was already there.