11<?php
22
3- namespace Enqueue \AmqpExt \ Tests \Client ;
3+ namespace Enqueue \Tests \Client \ Amqp ;
44
5- use Enqueue \AmqpExt \AmqpContext ;
6- use Enqueue \AmqpExt \Client \AmqpDriver ;
5+ use Enqueue \Client \Amqp \AmqpDriver ;
76use Enqueue \Client \Config ;
87use Enqueue \Client \DriverInterface ;
98use Enqueue \Client \Message ;
109use Enqueue \Client \Meta \QueueMetaRegistry ;
1110use Enqueue \Test \ClassExtensionTrait ;
11+ use Interop \Amqp \AmqpContext ;
12+ use Interop \Amqp \AmqpProducer ;
1213use Interop \Amqp \Impl \AmqpBind ;
1314use Interop \Amqp \Impl \AmqpMessage ;
1415use Interop \Amqp \Impl \AmqpQueue ;
1516use Interop \Amqp \Impl \AmqpTopic ;
16- use Interop \Queue \PsrProducer ;
1717use PHPUnit \Framework \TestCase ;
1818
1919class AmqpDriverTest extends TestCase
@@ -28,7 +28,7 @@ public function testShouldImplementsDriverInterface()
2828 public function testCouldBeConstructedWithRequiredArguments ()
2929 {
3030 new AmqpDriver (
31- $ this ->createPsrContextMock (),
31+ $ this ->createAmqpContextMock (),
3232 $ this ->createDummyConfig (),
3333 $ this ->createDummyQueueMetaRegistry ()
3434 );
@@ -38,7 +38,7 @@ public function testShouldReturnConfigObject()
3838 {
3939 $ config = $ this ->createDummyConfig ();
4040
41- $ driver = new AmqpDriver ($ this ->createPsrContextMock (), $ config , $ this ->createDummyQueueMetaRegistry ());
41+ $ driver = new AmqpDriver ($ this ->createAmqpContextMock (), $ config , $ this ->createDummyQueueMetaRegistry ());
4242
4343 $ this ->assertSame ($ config , $ driver ->getConfig ());
4444 }
@@ -47,7 +47,7 @@ public function testShouldCreateAndReturnQueueInstance()
4747 {
4848 $ expectedQueue = new AmqpQueue ('aName ' );
4949
50- $ context = $ this ->createPsrContextMock ();
50+ $ context = $ this ->createAmqpContextMock ();
5151 $ context
5252 ->expects ($ this ->once ())
5353 ->method ('createQueue ' )
@@ -69,7 +69,7 @@ public function testShouldCreateAndReturnQueueInstanceWithHardcodedTransportName
6969 {
7070 $ expectedQueue = new AmqpQueue ('aName ' );
7171
72- $ context = $ this ->createPsrContextMock ();
72+ $ context = $ this ->createAmqpContextMock ();
7373 $ context
7474 ->expects ($ this ->once ())
7575 ->method ('createQueue ' )
@@ -98,7 +98,7 @@ public function testShouldConvertTransportMessageToClientMessage()
9898 $ transportMessage ->setCorrelationId ('theCorrelationId ' );
9999
100100 $ driver = new AmqpDriver (
101- $ this ->createPsrContextMock (),
101+ $ this ->createAmqpContextMock (),
102102 $ this ->createDummyConfig (),
103103 $ this ->createDummyQueueMetaRegistry ()
104104 );
@@ -133,7 +133,7 @@ public function testShouldThrowExceptionIfExpirationIsNotNumeric()
133133 $ transportMessage ->setHeader ('expiration ' , 'is-not-numeric ' );
134134
135135 $ driver = new AmqpDriver (
136- $ this ->createPsrContextMock (),
136+ $ this ->createAmqpContextMock (),
137137 $ this ->createDummyConfig (),
138138 $ this ->createDummyQueueMetaRegistry ()
139139 );
@@ -157,7 +157,7 @@ public function testShouldConvertClientMessageToTransportMessage()
157157 $ clientMessage ->setReplyTo ('theReplyTo ' );
158158 $ clientMessage ->setCorrelationId ('theCorrelationId ' );
159159
160- $ context = $ this ->createPsrContextMock ();
160+ $ context = $ this ->createAmqpContextMock ();
161161 $ context
162162 ->expects ($ this ->once ())
163163 ->method ('createMessage ' )
@@ -198,13 +198,13 @@ public function testShouldSendMessageToRouter()
198198 $ topic = new AmqpTopic ('' );
199199 $ transportMessage = new AmqpMessage ();
200200
201- $ producer = $ this ->createPsrProducerMock ();
201+ $ producer = $ this ->createAmqpProducerMock ();
202202 $ producer
203203 ->expects ($ this ->once ())
204204 ->method ('send ' )
205205 ->with ($ this ->identicalTo ($ topic ), $ this ->identicalTo ($ transportMessage ))
206206 ;
207- $ context = $ this ->createPsrContextMock ();
207+ $ context = $ this ->createAmqpContextMock ();
208208 $ context
209209 ->expects ($ this ->once ())
210210 ->method ('createTopic ' )
@@ -236,7 +236,7 @@ public function testShouldSendMessageToRouter()
236236 public function testShouldThrowExceptionIfTopicParameterIsNotSet ()
237237 {
238238 $ driver = new AmqpDriver (
239- $ this ->createPsrContextMock (),
239+ $ this ->createAmqpContextMock (),
240240 $ this ->createDummyConfig (),
241241 $ this ->createDummyQueueMetaRegistry ()
242242 );
@@ -252,13 +252,13 @@ public function testShouldSendMessageToProcessor()
252252 $ queue = new AmqpQueue ('' );
253253 $ transportMessage = new AmqpMessage ();
254254
255- $ producer = $ this ->createPsrProducerMock ();
255+ $ producer = $ this ->createAmqpProducerMock ();
256256 $ producer
257257 ->expects ($ this ->once ())
258258 ->method ('send ' )
259259 ->with ($ this ->identicalTo ($ queue ), $ this ->identicalTo ($ transportMessage ))
260260 ;
261- $ context = $ this ->createPsrContextMock ();
261+ $ context = $ this ->createAmqpContextMock ();
262262 $ context
263263 ->expects ($ this ->once ())
264264 ->method ('createQueue ' )
@@ -291,7 +291,7 @@ public function testShouldSendMessageToProcessor()
291291 public function testShouldThrowExceptionIfProcessorNameParameterIsNotSet ()
292292 {
293293 $ driver = new AmqpDriver (
294- $ this ->createPsrContextMock (),
294+ $ this ->createAmqpContextMock (),
295295 $ this ->createDummyConfig (),
296296 $ this ->createDummyQueueMetaRegistry ()
297297 );
@@ -305,7 +305,7 @@ public function testShouldThrowExceptionIfProcessorNameParameterIsNotSet()
305305 public function testShouldThrowExceptionIfProcessorQueueNameParameterIsNotSet ()
306306 {
307307 $ driver = new AmqpDriver (
308- $ this ->createPsrContextMock (),
308+ $ this ->createAmqpContextMock (),
309309 $ this ->createDummyConfig (),
310310 $ this ->createDummyQueueMetaRegistry ()
311311 );
@@ -326,7 +326,7 @@ public function testShouldSetupBroker()
326326
327327 $ processorQueue = new AmqpQueue ('' );
328328
329- $ context = $ this ->createPsrContextMock ();
329+ $ context = $ this ->createAmqpContextMock ();
330330 // setup router
331331 $ context
332332 ->expects ($ this ->at (0 ))
@@ -381,17 +381,17 @@ public function testShouldSetupBroker()
381381 /**
382382 * @return \PHPUnit_Framework_MockObject_MockObject|AmqpContext
383383 */
384- private function createPsrContextMock ()
384+ private function createAmqpContextMock ()
385385 {
386386 return $ this ->createMock (AmqpContext::class);
387387 }
388388
389389 /**
390- * @return \PHPUnit_Framework_MockObject_MockObject|PsrProducer
390+ * @return \PHPUnit_Framework_MockObject_MockObject|AmqpProducer
391391 */
392- private function createPsrProducerMock ()
392+ private function createAmqpProducerMock ()
393393 {
394- return $ this ->createMock (PsrProducer ::class);
394+ return $ this ->createMock (AmqpProducer ::class);
395395 }
396396
397397 /**
0 commit comments