Skip to content

Commit

Permalink
make assertions indepent from mail order
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed Mar 20, 2024
1 parent f4d67aa commit 0943f52
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions tests/dailymail_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,21 @@ public function test_delivery_not_enrolled(): void {
// Check the recipient of the mails and the discussion that is addressed. There should be no false addressed discussions.
$firstmail = $content[0];
$secondmail = $content[1];
$this->assertEquals('[email protected]', $firstmail->to);
$this->assertStringContainsString($this->discussion[0]->name, $firstmail->body);
$this->assertStringNotContainsString($discussion[0]->name, $firstmail->body);

$this->assertEquals('[email protected]', $secondmail->to);
$this->assertStringContainsString($discussion[0]->name, $secondmail->body);
$this->assertStringNotContainsString($this->discussion[0]->name, $secondmail->body);
// Depending on the order of the mails, check the recipient and the discussion that is addressed.
if ($firstmail->to == "[email protected]") {
$this->assertStringContainsString($this->discussion[0]->name, $firstmail->body);
$this->assertStringNotContainsString($discussion[0]->name, $firstmail->body);
$this->assertEquals('[email protected]', $secondmail->to);
$this->assertStringContainsString($discussion[0]->name, $secondmail->body);
$this->assertStringNotContainsString($this->discussion[0]->name, $secondmail->body);
} else {
$this->assertEquals('[email protected]', $firstmail->to);
$this->assertStringContainsString($discussion[0]->name, $firstmail->body);
$this->assertStringNotContainsString($this->discussion[0]->name, $firstmail->body);
$this->assertEquals('[email protected]', $secondmail->to);
$this->assertStringContainsString($this->discussion[0]->name, $secondmail->body);
$this->assertStringNotContainsString($discussion[0]->name, $secondmail->body);
}
}


Expand Down

0 comments on commit 0943f52

Please sign in to comment.