66 * Copyright © Magento, Inc. All rights reserved.
77 * See COPYING.txt for license details.
88 */
9- declare (strict_types=1 );
109
1110namespace Magento \Framework \MessageQueue \Test \Unit \Topology \Config \QueueConfigItem ;
1211
@@ -23,17 +22,17 @@ class DataMapperTest extends TestCase
2322 /**
2423 * @var Data|MockObject
2524 */
26- private $ configData ;
25+ private $ configDataMock ;
2726
2827 /**
2928 * @var CommunicationConfig|MockObject
3029 */
31- private $ communicationConfig ;
30+ private $ communicationConfigMock ;
3231
3332 /**
3433 * @var ResponseQueueNameBuilder|MockObject
3534 */
36- private $ queueNameBuilder ;
35+ private $ queueNameBuilderMock ;
3736
3837 /**
3938 * @var DataMapper
@@ -45,10 +44,14 @@ class DataMapperTest extends TestCase
4544 */
4645 protected function setUp (): void
4746 {
48- $ this ->configData = $ this ->createMock (Data::class);
49- $ this ->communicationConfig = $ this ->createMock (CommunicationConfig::class);
50- $ this ->queueNameBuilder = $ this ->createMock (ResponseQueueNameBuilder::class);
51- $ this ->model = new DataMapper ($ this ->configData , $ this ->communicationConfig , $ this ->queueNameBuilder );
47+ $ this ->configDataMock = $ this ->createMock (Data::class);
48+ $ this ->communicationConfigMock = $ this ->createMock (CommunicationConfig::class);
49+ $ this ->queueNameBuilderMock = $ this ->createMock (ResponseQueueNameBuilder::class);
50+ $ this ->model = new DataMapper (
51+ $ this ->configDataMock ,
52+ $ this ->communicationConfigMock ,
53+ $ this ->queueNameBuilderMock
54+ );
5255 }
5356
5457 /**
@@ -112,11 +115,11 @@ public function testGetMappedData(): void
112115 ['topic02 ' , ['name ' => 'topic02 ' , 'is_synchronous ' => false ]],
113116 ];
114117
115- $ this ->communicationConfig ->expects ($ this ->exactly (2 ))
118+ $ this ->communicationConfigMock ->expects ($ this ->exactly (2 ))
116119 ->method ('getTopic ' )
117120 ->willReturnMap ($ communicationMap );
118- $ this ->configData ->expects ($ this ->once ())->method ('get ' )->willReturn ($ data );
119- $ this ->queueNameBuilder ->expects ($ this ->once ())
121+ $ this ->configDataMock ->expects ($ this ->once ())->method ('get ' )->willReturn ($ data );
122+ $ this ->queueNameBuilderMock ->expects ($ this ->once ())
120123 ->method ('getQueueName ' )
121124 ->with ('topic01 ' )
122125 ->willReturn ('responseQueue.topic01 ' );
@@ -218,15 +221,15 @@ public function testGetMappedDataForWildcard(): void
218221 'topic08.part2.some.test ' => ['name ' => 'topic08.part2.some.test ' , 'is_synchronous ' => true ],
219222 ];
220223
221- $ this ->communicationConfig ->expects ($ this ->once ())
224+ $ this ->communicationConfigMock ->expects ($ this ->once ())
222225 ->method ('getTopic ' )
223226 ->with ('topic01 ' )
224227 ->willReturn (['name ' => 'topic01 ' , 'is_synchronous ' => true ]);
225- $ this ->communicationConfig ->expects ($ this ->any ())
228+ $ this ->communicationConfigMock ->expects ($ this ->any ())
226229 ->method ('getTopics ' )
227230 ->willReturn ($ communicationData );
228- $ this ->configData ->expects ($ this ->once ())->method ('get ' )->willReturn ($ data );
229- $ this ->queueNameBuilder ->expects ($ this ->any ())
231+ $ this ->configDataMock ->expects ($ this ->once ())->method ('get ' )->willReturn ($ data );
232+ $ this ->queueNameBuilderMock ->expects ($ this ->any ())
230233 ->method ('getQueueName ' )
231234 ->willReturnCallback (function ($ value ) {
232235 return 'responseQueue. ' . $ value ;
0 commit comments