Update for queue message API changes#135
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates this AMQP adapter package to align with recent yiisoft/queue message API changes, primarily around the new serializer namespace and the shift from data/metadata to payload/meta in message handling, plus aligning middleware-related tests with the current Queue construction API.
Changes:
- Migrated usages of
JsonMessageSerializertoMessageSerializer+JsonMessageEncoder, and updatedMessageSerializerInterfaceimport namespace. - Updated test message helpers/handlers and tests from
getData()/getMetadata()+fromData()togetPayload()/getMeta()+fromPayload(). - Adjusted middleware integration test queue construction to pass the default queue name and middleware definitions via constructor.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/yii | Updates test CLI bootstrap to use the new serializer classes. |
| tests/Unit/UnitTestCase.php | Switches handler logic to getPayload() and updates serializer instantiation. |
| tests/Unit/QueueTest.php | Migrates unit tests to fromPayload() and new serializer classes/namespaces. |
| tests/Unit/QueueSettingsTest.php | Updates serializer instantiation and message factory usage in settings tests. |
| tests/Unit/QueueProviderTest.php | Updates serializer usage and adjusts decoded message body assertion to the new top-level payload key. |
| tests/Unit/DelayMiddlewareTest.php | Migrates unit middleware tests to fromPayload(). |
| tests/Support/TestMessage.php | Updates the test message implementation to the new payload/meta API. |
| tests/Support/SimpleMessageHandler.php | Switches handler to read message payload instead of data. |
| tests/Support/FakeAdapter.php | Updates serializer interface import namespace. |
| tests/Support/ExtendedSimpleMessageHandler.php | Switches handler to read message payload instead of data. |
| tests/Integration/DelayMiddlewareTest.php | Updates serializer usage and aligns queue construction with current Queue constructor API for middlewares. |
| tests/Integration/ConsumeExistingMessagesTest.php | Migrates integration tests to new serializer and payload-based message creation. |
| tests/Benchmark/QueuePushBench.php | Updates benchmark setup and message creation to new serializer/payload API. |
| tests/Benchmark/QueueConsumeBench.php | Updates benchmark setup and message creation to new serializer/payload API. |
| src/ExistingMessagesConsumer.php | Updates serializer interface import namespace. |
| src/Adapter.php | Updates serializer interface import namespace. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests