@@ -181,13 +181,21 @@ public function test_delivery_not_enrolled(): void {
181
181
// Check the recipient of the mails and the discussion that is addressed. There should be no false addressed discussions.
182
182
$ firstmail = $ content [0 ];
183
183
$ secondmail = $ content [1 ];
184
- $ this ->
assertEquals (
'[email protected] ' ,
$ firstmail->
to );
185
- $ this ->assertStringContainsString ($ this ->discussion [0 ]->name , $ firstmail ->body );
186
- $ this ->assertStringNotContainsString ($ discussion [0 ]->name , $ firstmail ->body );
187
-
188
- $ this ->
assertEquals (
'[email protected] ' ,
$ secondmail->
to );
189
- $ this ->assertStringContainsString ($ discussion [0 ]->name , $ secondmail ->body );
190
- $ this ->assertStringNotContainsString ($ this ->discussion [0 ]->name , $ secondmail ->body );
184
+ // Depending on the order of the mails, check the recipient and the discussion that is addressed.
185
+ if (
$ firstmail->
to ==
"[email protected] " ) {
186
+ $ this ->assertStringContainsString ($ this ->discussion [0 ]->name , $ firstmail ->body );
187
+ $ this ->assertStringNotContainsString ($ discussion [0 ]->name , $ firstmail ->body );
188
+ $ this ->
assertEquals (
'[email protected] ' ,
$ secondmail->
to );
189
+ $ this ->assertStringContainsString ($ discussion [0 ]->name , $ secondmail ->body );
190
+ $ this ->assertStringNotContainsString ($ this ->discussion [0 ]->name , $ secondmail ->body );
191
+ } else {
192
+ $ this ->
assertEquals (
'[email protected] ' ,
$ firstmail->
to );
193
+ $ this ->assertStringContainsString ($ discussion [0 ]->name , $ firstmail ->body );
194
+ $ this ->assertStringNotContainsString ($ this ->discussion [0 ]->name , $ firstmail ->body );
195
+ $ this ->
assertEquals (
'[email protected] ' ,
$ secondmail->
to );
196
+ $ this ->assertStringContainsString ($ this ->discussion [0 ]->name , $ secondmail ->body );
197
+ $ this ->assertStringNotContainsString ($ discussion [0 ]->name , $ secondmail ->body );
198
+ }
191
199
}
192
200
193
201
0 commit comments