23 private $objectManagerHelper;
37 $this->configMock = $this->getMockBuilder(ConfigInterface::class)
38 ->getMockForAbstractClass();
39 $this->subjectMock = $this->getMockBuilder(ConsumerConfigCompositeReader::class)
40 ->disableOriginalConstructor()
43 $this->objectManagerHelper =
new ObjectManagerHelper($this);
44 $this->plugin = $this->objectManagerHelper->getObject(
45 ConsumerConfigReaderPlugin::class,
46 [
'config' => $this->configMock]
55 'name' =>
'consumer1',
57 [
'handlerConfig1_1_1',
'handlerConfig1_1_2'],
58 [
'handlerConfig1_2_1']
60 'queue' => [
'item1_1',
'item1_2'],
61 'instance_type' =>
'type1',
62 'connection' =>
'connection1',
66 'name' =>
'consumer2',
68 'queue' => [
'item2_1'],
69 'instance_type' =>
'type2',
70 'connection' =>
'connection2',
76 'name' =>
'consumer1',
77 'queue' => [
'item1_1',
'item1_2'],
78 'consumerInstance' =>
'type1',
79 'handlers' => [
'handlerConfig1_1_1',
'handlerConfig1_1_2',
'handlerConfig1_2_1'],
80 'connection' =>
'connection1',
84 'name' =>
'consumer2',
85 'queue' => [
'item2_1'],
86 'consumerInstance' =>
'type2',
88 'connection' =>
'connection2',
94 $this->configMock->expects(static::atLeastOnce())
95 ->method(
'getConsumers')
96 ->willReturn($consumers);
98 $this->assertEquals($finalResult, $this->plugin->afterRead($this->subjectMock,
$result));