23 private $objectManagerHelper;
37 $this->configMock = $this->getMockBuilder(ConfigInterface::class)
38 ->getMockForAbstractClass();
39 $this->subjectMock = $this->getMockBuilder(TopologyConfigCompositeReader::class)
40 ->disableOriginalConstructor()
41 ->setMethods([
'getBinds',
'getConnectionByTopic'])
44 $this->objectManagerHelper =
new ObjectManagerHelper($this);
45 $this->plugin = $this->objectManagerHelper->getObject(
46 TopologyConfigReaderPlugin::class,
47 [
'queueConfig' => $this->configMock]
55 'queue' =>
'catalog_product_removed_queue',
56 'exchange' =>
'magento-db',
57 'topic' =>
'catalog.product.removed' 60 'queue' =>
'inventory_qty_counter_queue',
61 'exchange' =>
'magento',
62 'topic' =>
'inventory.counter.updated' 68 'connection' =>
'amqp',
72 'id' =>
'defaultBinding',
73 'destinationType' =>
'queue',
74 'destination' =>
'catalog_product_removed_queue',
75 'topic' =>
'catalog.product.removed',
77 $amqpDefaultBinding = [
78 'id' =>
'defaultBinding',
79 'destinationType' =>
'queue',
80 'destination' =>
'inventory_qty_counter_queue',
81 'topic' =>
'inventory.counter.updated',
84 'magento' => $magento,
86 'name' =>
'magento-db',
90 'defaultBinding' => $dbDefaultBinding
96 'connection' =>
'amqp',
98 'defaultBinding' => $amqpDefaultBinding
103 'magento' => $magento,
104 'magento-db--db' => [
105 'name' =>
'magento-db',
107 'connection' =>
'db',
109 'queue--catalog_product_removed_queue--catalog.product.removed' => [
110 'id' =>
'queue--catalog_product_removed_queue--catalog.product.removed',
111 'destinationType' =>
'queue',
112 'destination' =>
'catalog_product_removed_queue',
114 'topic' =>
'catalog.product.removed',
117 'defaultBinding' => $dbDefaultBinding
123 'connection' =>
'amqp',
125 'queue--inventory_qty_counter_queue--inventory.counter.updated' => [
126 'id' =>
'queue--inventory_qty_counter_queue--inventory.counter.updated',
127 'destinationType' =>
'queue',
128 'destination' =>
'inventory_qty_counter_queue',
130 'topic' =>
'inventory.counter.updated',
133 'defaultBinding' => $amqpDefaultBinding
138 $this->configMock->expects(static::atLeastOnce())
140 ->willReturn($binding);
141 $this->configMock->expects(static::exactly(2))
142 ->method(
'getConnectionByTopic')
144 [
'catalog.product.removed',
'db'],
145 [
'inventory.counter.updated',
'amqp']
148 $this->assertEquals($expectedResult, $this->plugin->afterRead($this->subjectMock,
$result));