Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/email_certificate_task_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ public function test_email_certificates_teachers() {
// Confirm that we only sent out 2 emails, both emails to the teacher for the two students.
$this->assertCount(2, $emails);

$this->assertStringContainsString(fullname($user3), utf8_encode($emails[0]->header));
$this->assertStringContainsString(fullname($user3), mb_convert_encoding($emails[0]->header, 'UTF-8', 'ISO-8859-1'));
$this->assertEquals($CFG->noreplyaddress, $emails[0]->from);
$this->assertEquals($user3->email, $emails[0]->to);

$this->assertStringContainsString(fullname($user3), utf8_encode($emails[1]->header));
$this->assertStringContainsString(fullname($user3), mb_convert_encoding($emails[1]->header, 'UTF-8', 'ISO-8859-1'));
$this->assertEquals($CFG->noreplyaddress, $emails[1]->from);
$this->assertEquals($user3->email, $emails[1]->to);
}
Expand Down Expand Up @@ -189,11 +189,11 @@ public function test_email_certificates_others() {
// Confirm that we only sent out 2 emails, both emails to the other address that was valid for the two students.
$this->assertCount(2, $emails);

$this->assertStringContainsString(fullname(get_admin()), utf8_encode($emails[0]->header));
$this->assertStringContainsString(fullname(get_admin()), mb_convert_encoding($emails[0]->header, 'UTF-8', 'ISO-8859-1'));
$this->assertEquals($CFG->noreplyaddress, $emails[0]->from);
$this->assertEquals('testcustomcert@example.com', $emails[0]->to);

$this->assertStringContainsString(fullname(get_admin()), utf8_encode($emails[1]->header));
$this->assertStringContainsString(fullname(get_admin()), mb_convert_encoding($emails[1]->header, 'UTF-8', 'ISO-8859-1'));
$this->assertEquals($CFG->noreplyaddress, $emails[1]->from);
$this->assertEquals('testcustomcert@example.com', $emails[1]->to);
}
Expand Down