48 private $publisherConsumerController;
53 $this->logFilePath = TESTS_TEMP_DIR .
"/MessageQueueTestLog.txt";
54 $this->publisherConsumerController = $this->objectManager->create(PublisherConsumerController::class, [
55 'consumers' => $this->consumers,
56 'logFilePath' => $this->logFilePath,
57 'maxMessages' => $this->maxMessages,
62 $this->publisherConsumerController->initialize();
64 $this->markTestSkipped($e->getMessage());
70 $this->publisher = $this->publisherConsumerController->getPublisher();
75 $this->publisherConsumerController->stopConsumers();
88 $this->publisherConsumerController->waitForAsynchronousResult([$this,
'checkLogsExists'], [
92 $this->fail($e->getMessage());
98 $actualCount = file_exists($this->logFilePath) ? count(file($this->logFilePath)) : 0;
99 return $expectedLinesCount === $actualCount;
107 if (version_compare(phpversion(),
'7') == -1) {
108 $closeConnection = new \ReflectionMethod(\
Magento\Amqp\Model\Config::class,
'closeConnection');
109 $closeConnection->setAccessible(
true);
112 $closeConnection->invoke(
$config);
waitForAsynchronousResult($expectedLinesCount, $logFilePath)
static tearDownAfterClass()
static getObjectManager()
checkLogsExists($expectedLinesCount)