6
6
* Copyright © Magento, Inc. All rights reserved.
7
7
* See COPYING.txt for license details.
8
8
*/
9
- declare (strict_types=1 );
10
9
11
10
namespace Magento \Framework \MessageQueue \Test \Unit \Topology \Config \QueueConfigItem ;
12
11
@@ -23,17 +22,17 @@ class DataMapperTest extends TestCase
23
22
/**
24
23
* @var Data|MockObject
25
24
*/
26
- private $ configData ;
25
+ private $ configDataMock ;
27
26
28
27
/**
29
28
* @var CommunicationConfig|MockObject
30
29
*/
31
- private $ communicationConfig ;
30
+ private $ communicationConfigMock ;
32
31
33
32
/**
34
33
* @var ResponseQueueNameBuilder|MockObject
35
34
*/
36
- private $ queueNameBuilder ;
35
+ private $ queueNameBuilderMock ;
37
36
38
37
/**
39
38
* @var DataMapper
@@ -45,10 +44,14 @@ class DataMapperTest extends TestCase
45
44
*/
46
45
protected function setUp (): void
47
46
{
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
+ );
52
55
}
53
56
54
57
/**
@@ -112,11 +115,11 @@ public function testGetMappedData(): void
112
115
['topic02 ' , ['name ' => 'topic02 ' , 'is_synchronous ' => false ]],
113
116
];
114
117
115
- $ this ->communicationConfig ->expects ($ this ->exactly (2 ))
118
+ $ this ->communicationConfigMock ->expects ($ this ->exactly (2 ))
116
119
->method ('getTopic ' )
117
120
->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 ())
120
123
->method ('getQueueName ' )
121
124
->with ('topic01 ' )
122
125
->willReturn ('responseQueue.topic01 ' );
@@ -218,15 +221,15 @@ public function testGetMappedDataForWildcard(): void
218
221
'topic08.part2.some.test ' => ['name ' => 'topic08.part2.some.test ' , 'is_synchronous ' => true ],
219
222
];
220
223
221
- $ this ->communicationConfig ->expects ($ this ->once ())
224
+ $ this ->communicationConfigMock ->expects ($ this ->once ())
222
225
->method ('getTopic ' )
223
226
->with ('topic01 ' )
224
227
->willReturn (['name ' => 'topic01 ' , 'is_synchronous ' => true ]);
225
- $ this ->communicationConfig ->expects ($ this ->any ())
228
+ $ this ->communicationConfigMock ->expects ($ this ->any ())
226
229
->method ('getTopics ' )
227
230
->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 ())
230
233
->method ('getQueueName ' )
231
234
->willReturnCallback (function ($ value ) {
232
235
return 'responseQueue. ' . $ value ;
0 commit comments