Remove FakeAdapter#303
Merged
Merged
Conversation
vjik
commented
Jun 7, 2026
Member
| Q | A |
|---|---|
| Is bugfix? | ❌ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
| Tests pass? | ✔️ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #303 +/- ##
========================================
Coverage 0.00% 0.00%
Complexity 330 330
========================================
Files 49 49
Lines 906 906
========================================
Misses 906 906 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
samdark
approved these changes
Jun 7, 2026
Member
|
👍 |
There was a problem hiding this comment.
Pull request overview
This PR removes the custom FakeAdapter test double and switches unit tests to use the existing Yiisoft\Queue\Stubs\InMemoryAdapter, adding a small accessor to inspect queued messages in assertions.
Changes:
- Removed
tests/App/FakeAdapter.phpand replaced its usage across unit tests withStubs\InMemoryAdapter. - Updated assertions that previously relied on
FakeAdapter::$pushMessagesto use a newInMemoryAdapter::getMessagesList()accessor. - Added
InMemoryAdapter::getMessagesList()to support message list assertions in tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/QueueTest.php | Uses InMemoryAdapter and getMessagesList() for push assertions instead of FakeAdapter. |
| tests/Unit/Middleware/Push/MiddlewareFactoryTest.php | Binds AdapterInterface to InMemoryAdapter in the container setup. |
| tests/Unit/Middleware/Push/MiddlewareDispatcherTest.php | Uses InMemoryAdapter in dispatcher/container wiring. |
| tests/Unit/Middleware/Push/AdapterPushHandlerTest.php | Switches adapter to InMemoryAdapter and asserts pushed messages via getMessagesList(). |
| tests/Unit/Middleware/FailureHandling/MiddlewareFactoryTest.php | Replaces FakeAdapter with InMemoryAdapter for container wiring. |
| tests/Unit/Middleware/FailureHandling/MiddlewareDispatcherTest.php | Uses InMemoryAdapter in dispatcher/container wiring. |
| tests/Unit/Middleware/Consume/MiddlewareFactoryTest.php | Replaces FakeAdapter with InMemoryAdapter for container wiring. |
| tests/Unit/Middleware/Consume/MiddlewareDispatcherTest.php | Uses InMemoryAdapter in dispatcher/container wiring. |
| tests/App/FakeAdapter.php | Removed (no longer needed after switching tests to InMemoryAdapter). |
| stubs/InMemoryAdapter.php | Adds getMessagesList() accessor for test assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
18
to
+22
| $message = new GenericMessage('handler', 'data'); | ||
|
|
||
| $result = $handler->handlePush($message); | ||
| $handler->handlePush($message); | ||
|
|
||
| self::assertSame($message, $result); | ||
| self::assertSame([$message], $adapter->pushMessages); | ||
| self::assertSame([$message], $adapter->getMessagesList()); |
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.