Invalidation event type proposal#44
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Fix blank line after <?php in EventType.php - Rename $collectTagsResponseTagger to $traceableResponseTagger in TraceableResponseTaggerTest - Fix broken fromElement() calls in InvalidateElementListenerTest (missing EventType arg) - Add tests verifying EventType::Update and EventType::Delete are dispatched correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
0b13633 to
9ed6752
Compare
There was a problem hiding this comment.
Pull request overview
Introduces an explicit EventType for element invalidation events and updates unit tests to validate the dispatched event type for update vs delete operations.
Changes:
- Update
ElementInvalidationEvent::fromElement(...)usages in tests to pass the newEventType(Update/Delete). - Add new unit tests asserting that
InvalidateElementListenerdispatches invalidation events with the correct type. - Rename a test property in
TraceableResponseTaggerTest(currently inconsistent with remaining usages).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Unit/Element/InvalidateElementListenerTest.php | Passes EventType to ElementInvalidationEvent::fromElement and adds assertions for dispatched event type. |
| tests/Unit/Cache/ResponseTagger/TraceableResponseTaggerTest.php | Renames the tagger property, but the rename is incomplete and breaks the test. |
| src/Element/EventType.php | Adjusts file header formatting while defining the EventType enum (Update/Delete). |
Comments suppressed due to low confidence (1)
tests/Unit/Cache/ResponseTagger/TraceableResponseTaggerTest.php:26
- The property was renamed to
$traceableResponseTagger, but the rest of the test still assigns to and uses$collectTagsResponseTagger. This will result in an undefined property / failing tests. Please updatesetUp()and all usages to consistently use the new property name (or keep the old name everywhere).
private TraceableResponseTagger $traceableResponseTagger;
/** @var ObjectProphecy<ResponseTagger> */
private ObjectProphecy $innerTagger;
protected function setUp(): void
{
$this->innerTagger = $this->prophesize(ResponseTagger::class);
$this->collectTagsResponseTagger = new TraceableResponseTagger($this->innerTagger->reveal());
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/Unit/Cache/ResponseTagger/TraceableResponseTaggerTest.php`:
- Line 17: The typed property TraceableResponseTagger $traceableResponseTagger
is declared but the tests use the wrong runtime property name
$collectTagsResponseTagger; update all usages to match the declared property by
replacing every $collectTagsResponseTagger with $traceableResponseTagger in
setUp() and the tests tag_should_collect_tags,
tag_should_forward_tags_to_inner_tagger, and reset_should_reset_collected_tags
so the typed property is actually used and no runtime property access issues
occur.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/Element/EventType.phptests/Unit/Cache/ResponseTagger/TraceableResponseTaggerTest.phptests/Unit/Element/InvalidateElementListenerTest.php
… to traceableResponseTagger Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary by CodeRabbit
Tests
Refactor
Style