Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AsyncMultiTopicsSeparateQueuesTest.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  protected $uniqueID;
16 
20  protected $msgObject;
21 
25  protected $consumers = [
26  'queue.for.multiple.topics.test.c.deprecated',
27  'queue.for.multiple.topics.test.d.deprecated'
28  ];
29 
33  private $topics = ['multi.topic.queue.topic.c.deprecated', 'multi.topic.queue.topic.d.deprecated'];
34 
41  {
42  $this->msgObject = $this->objectManager->create(\Magento\TestModuleAsyncAmqp\Model\AsyncTestData::class);
43 
44  foreach ($this->topics as $topic) {
45  $this->uniqueID[$topic] = md5(uniqid($topic));
46  $this->msgObject->setValue($this->uniqueID[$topic] . "_" . $topic);
47  $this->msgObject->setTextFilePath($this->logFilePath);
48  $this->publisher->publish($topic, $this->msgObject);
49  }
50 
51  $this->waitForAsynchronousResult(count($this->uniqueID), $this->logFilePath);
52 
53  //assertions
54  foreach ($this->topics as $item) {
55  $this->assertContains($this->uniqueID[$item] . "_" . $item, file_get_contents($this->logFilePath));
56  }
57  }
58 }