From 458553741288ff7090617e9289f97c23b2e9d473 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Sat, 2 May 2026 19:51:24 +0300 Subject: [PATCH] Remove `DummyQueue` favor in `StubQueue` --- tests/App/DummyQueue.php | 50 ------------------- tests/Unit/Debug/QueueCollectorTest.php | 8 +-- .../Debug/QueueWorkerInterfaceProxyTest.php | 4 +- 3 files changed, 6 insertions(+), 56 deletions(-) delete mode 100644 tests/App/DummyQueue.php diff --git a/tests/App/DummyQueue.php b/tests/App/DummyQueue.php deleted file mode 100644 index 9cfb0875..00000000 --- a/tests/App/DummyQueue.php +++ /dev/null @@ -1,50 +0,0 @@ -name; - } - - public function withMiddlewares(PushMiddlewareInterface|callable|array|string ...$middlewareDefinitions): self - { - throw new Exception('`withMiddlewares()` method is not implemented yet.'); - } - - public function withMiddlewaresAdded(PushMiddlewareInterface|callable|array|string ...$middlewareDefinitions): self - { - throw new Exception('`withMiddlewaresAdded()` method is not implemented yet.'); - } -} diff --git a/tests/Unit/Debug/QueueCollectorTest.php b/tests/Unit/Debug/QueueCollectorTest.php index 5ed42be8..56d6e95b 100644 --- a/tests/Unit/Debug/QueueCollectorTest.php +++ b/tests/Unit/Debug/QueueCollectorTest.php @@ -9,7 +9,7 @@ use Yiisoft\Yii\Debug\Tests\Shared\AbstractCollectorTestCase; use Yiisoft\Queue\Debug\QueueCollector; use Yiisoft\Queue\Message\Message; -use Yiisoft\Queue\Tests\App\DummyQueue; +use Yiisoft\Queue\Stubs\StubQueue; final class QueueCollectorTest extends AbstractCollectorTestCase { @@ -32,15 +32,15 @@ protected function collectTestData(CollectorInterface $collector): void $collector->collectPush('chan2', $this->pushMessage); $collector->collectWorkerProcessing( $this->pushMessage, - new DummyQueue('chan1'), + new StubQueue('chan1'), ); $collector->collectWorkerProcessing( $this->pushMessage, - new DummyQueue('chan1'), + new StubQueue('chan1'), ); $collector->collectWorkerProcessing( $this->pushMessage, - new DummyQueue('chan2'), + new StubQueue('chan2'), ); } diff --git a/tests/Unit/Debug/QueueWorkerInterfaceProxyTest.php b/tests/Unit/Debug/QueueWorkerInterfaceProxyTest.php index acd63e3e..66b73b6d 100644 --- a/tests/Unit/Debug/QueueWorkerInterfaceProxyTest.php +++ b/tests/Unit/Debug/QueueWorkerInterfaceProxyTest.php @@ -8,7 +8,7 @@ use Yiisoft\Queue\Debug\QueueCollector; use Yiisoft\Queue\Debug\QueueWorkerInterfaceProxy; use Yiisoft\Queue\Message\Message; -use Yiisoft\Queue\Tests\App\DummyQueue; +use Yiisoft\Queue\Stubs\StubQueue; use Yiisoft\Queue\Stubs\StubWorker; final class QueueWorkerInterfaceProxyTest extends TestCase @@ -20,7 +20,7 @@ public function testProcessDelegatesToWorker(): void $collector->startup(); $proxy = new QueueWorkerInterfaceProxy(new StubWorker(), $collector); - $result = $proxy->process($message, new DummyQueue('chan')); + $result = $proxy->process($message, new StubQueue('chan')); self::assertSame($message, $result);