Skip to content

Remove FakeAdapter#303

Merged
samdark merged 1 commit into
masterfrom
fake-adapter
Jun 7, 2026
Merged

Remove FakeAdapter#303
samdark merged 1 commit into
masterfrom
fake-adapter

Conversation

@vjik

@vjik vjik commented Jun 7, 2026

Copy link
Copy Markdown
Member
Q A
Is bugfix?
New feature?
Breaks BC?
Tests pass? ✔️

@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (2815730) to head (f972155).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samdark samdark merged commit 1957c87 into master Jun 7, 2026
29 checks passed
@samdark samdark deleted the fake-adapter branch June 7, 2026 21:29
@samdark

samdark commented Jun 7, 2026

Copy link
Copy Markdown
Member

👍

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.php and replaced its usage across unit tests with Stubs\InMemoryAdapter.
  • Updated assertions that previously relied on FakeAdapter::$pushMessages to use a new InMemoryAdapter::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());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants