@@ -65,7 +65,9 @@ protected function setUp(): void
65
65
*/
66
66
public function testWaitForMessages ()
67
67
{
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 ' ]);
69
71
70
72
foreach ($ this ->messages as $ message ) {
71
73
$ this ->publishMessage ($ message );
@@ -74,12 +76,12 @@ public function testWaitForMessages()
74
76
$ this ->waitForAsynchronousResult (count ($ this ->messages ), $ this ->logFilePath );
75
77
76
78
foreach ($ this ->messages as $ item ) {
77
- $ this ->assertContains ($ item , file_get_contents ($ this ->logFilePath ));
79
+ $ this ->assertStringContainsString ($ item , file_get_contents ($ this ->logFilePath ));
78
80
}
79
81
80
82
$ this ->publishMessage ('message4 ' );
81
83
$ 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 ));
83
85
}
84
86
85
87
/**
@@ -93,7 +95,10 @@ public function testNotWaitForMessages(): void
93
95
$ config ['queue ' ]['consumers_wait_for_messages ' ] = 0 ;
94
96
$ this ->writeConfig ($ config );
95
97
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 ' ]);
97
102
foreach ($ this ->messages as $ message ) {
98
103
$ this ->publishMessage ($ message );
99
104
}
@@ -102,14 +107,13 @@ public function testNotWaitForMessages(): void
102
107
$ this ->waitForAsynchronousResult (count ($ this ->messages ), $ this ->logFilePath );
103
108
104
109
foreach ($ this ->messages as $ item ) {
105
- $ this ->assertContains ($ item , file_get_contents ($ this ->logFilePath ));
110
+ $ this ->assertStringContainsString ($ item , file_get_contents ($ this ->logFilePath ));
106
111
}
107
112
108
113
// 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 ' ]);
113
117
}
114
118
115
119
/**
0 commit comments