|
4 | 4 |
|
5 | 5 | use Doctrine\DBAL\Connection; |
6 | 6 | use Enqueue\Bundle\Consumption\Extension\DoctrinePingConnectionExtension; |
7 | | -use Enqueue\Consumption\Context; |
| 7 | +use Enqueue\Consumption\Context\MessageReceived; |
8 | 8 | use Interop\Queue\Consumer; |
9 | 9 | use Interop\Queue\Context as InteropContext; |
| 10 | +use Interop\Queue\Message; |
10 | 11 | use Interop\Queue\Processor; |
11 | 12 | use PHPUnit\Framework\TestCase; |
12 | 13 | use Psr\Log\LoggerInterface; |
@@ -55,7 +56,7 @@ public function testShouldNotReconnectIfConnectionIsOK() |
55 | 56 | ; |
56 | 57 |
|
57 | 58 | $extension = new DoctrinePingConnectionExtension($registry); |
58 | | - $extension->onPreReceived($context); |
| 59 | + $extension->onMessageReceived($context); |
59 | 60 | } |
60 | 61 |
|
61 | 62 | public function testShouldDoesReconnectIfConnectionFailed() |
@@ -100,7 +101,7 @@ public function testShouldDoesReconnectIfConnectionFailed() |
100 | 101 | ; |
101 | 102 |
|
102 | 103 | $extension = new DoctrinePingConnectionExtension($registry); |
103 | | - $extension->onPreReceived($context); |
| 104 | + $extension->onMessageReceived($context); |
104 | 105 | } |
105 | 106 |
|
106 | 107 | public function testShouldSkipIfConnectionWasNotOpened() |
@@ -143,17 +144,18 @@ public function testShouldSkipIfConnectionWasNotOpened() |
143 | 144 | ; |
144 | 145 |
|
145 | 146 | $extension = new DoctrinePingConnectionExtension($registry); |
146 | | - $extension->onPreReceived($context); |
| 147 | + $extension->onMessageReceived($context); |
147 | 148 | } |
148 | 149 |
|
149 | | - protected function createContext(): Context |
| 150 | + protected function createContext(): MessageReceived |
150 | 151 | { |
151 | | - $context = new Context($this->createMock(InteropContext::class)); |
152 | | - $context->setLogger($this->createMock(LoggerInterface::class)); |
153 | | - $context->setConsumer($this->createMock(Consumer::class)); |
154 | | - $context->setProcessor($this->createMock(Processor::class)); |
155 | | - |
156 | | - return $context; |
| 152 | + return new MessageReceived( |
| 153 | + $this->createMock(InteropContext::class), |
| 154 | + $this->createMock(Consumer::class), |
| 155 | + $this->createMock(Message::class), |
| 156 | + $this->createMock(Processor::class), |
| 157 | + $this->createMock(LoggerInterface::class) |
| 158 | + ); |
157 | 159 | } |
158 | 160 |
|
159 | 161 | /** |
|
0 commit comments