Skip to content

Commit 432dd4a

Browse files
committed
MC-33909: Fix Integration tests php 7.4
1 parent b90fffb commit 432dd4a

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

dev/tests/integration/testsuite/Magento/Framework/MessageQueue/UseCase/WaitAndNotWaitMessagesTest.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ protected function setUp(): void
6565
*/
6666
public function testWaitForMessages()
6767
{
68-
$this->assertArraySubset(['queue' => ['consumers_wait_for_messages' => 1]], $this->config);
68+
$this->assertArrayHasKey('queue', $this->config);
69+
$this->assertArrayHasKey('consumers_wait_for_messages', $this->config['queue']);
70+
$this->assertEquals(1, $this->config['queue']['consumers_wait_for_messages']);
6971

7072
foreach ($this->messages as $message) {
7173
$this->publishMessage($message);
@@ -74,12 +76,12 @@ public function testWaitForMessages()
7476
$this->waitForAsynchronousResult(count($this->messages), $this->logFilePath);
7577

7678
foreach ($this->messages as $item) {
77-
$this->assertContains($item, file_get_contents($this->logFilePath));
79+
$this->assertStringContainsString($item, file_get_contents($this->logFilePath));
7880
}
7981

8082
$this->publishMessage('message4');
8183
$this->waitForAsynchronousResult(count($this->messages) + 1, $this->logFilePath);
82-
$this->assertContains('message4', file_get_contents($this->logFilePath));
84+
$this->assertStringContainsString('message4', file_get_contents($this->logFilePath));
8385
}
8486

8587
/**
@@ -93,7 +95,10 @@ public function testNotWaitForMessages(): void
9395
$config['queue']['consumers_wait_for_messages'] = 0;
9496
$this->writeConfig($config);
9597

96-
$this->assertArraySubset(['queue' => ['consumers_wait_for_messages' => 0]], $this->loadConfig());
98+
$loadedConfig = $this->loadConfig();
99+
$this->assertArrayHasKey('queue', $loadedConfig);
100+
$this->assertArrayHasKey('consumers_wait_for_messages', $loadedConfig['queue']);
101+
$this->assertEquals(0, $loadedConfig['queue']['consumers_wait_for_messages']);
97102
foreach ($this->messages as $message) {
98103
$this->publishMessage($message);
99104
}
@@ -102,14 +107,13 @@ public function testNotWaitForMessages(): void
102107
$this->waitForAsynchronousResult(count($this->messages), $this->logFilePath);
103108

104109
foreach ($this->messages as $item) {
105-
$this->assertContains($item, file_get_contents($this->logFilePath));
110+
$this->assertStringContainsString($item, file_get_contents($this->logFilePath));
106111
}
107112

108113
// Checks that consumers do not wait 4th message and die
109-
$this->assertArraySubset(
110-
['mixed.sync.and.async.queue.consumer' => []],
111-
$this->publisherConsumerController->getConsumersProcessIds()
112-
);
114+
$consumersProcessIds = $this->publisherConsumerController->getConsumersProcessIds();
115+
$this->assertArrayHasKey('mixed.sync.and.async.queue.consumer', $consumersProcessIds);
116+
$this->assertEquals([], $consumersProcessIds['mixed.sync.and.async.queue.consumer']);
113117
}
114118

115119
/**

0 commit comments

Comments
 (0)