Skip to content
Snippets Groups Projects
Commit 1e05f033 authored by andrew farquharson's avatar andrew farquharson
Browse files

use same test function etc in FunctionalJavascript test

parent 8f26ffc9
No related branches found
No related tags found
1 merge request!10611Keep user emails plain text
......@@ -84,6 +84,9 @@ public function testUserPasswordResetWithAdditionalAjaxForm(): void {
$edit['name'] = $this->account->getAccountName();
$this->submitForm($edit, 'Submit');
// Check that the email message body does not contain HTML entities
$this->assertTrue($this->checkBodyText(), 'The body text of the email contains no HTML entities');
$resetURL = $this->getResetURL();
$this->drupalGet($resetURL);
......@@ -122,4 +125,17 @@ public function getResetURL() {
return $urls[0];
}
/**
* Checks the email body text for the presence of HTML entities.
*/
public function checkBodyText(): bool {
// Assume the most recent email.
$_emails = $this->drupalGetMails();
$email = end($_emails);
if (strip_tags($email['body']) === $email['body']) {
return TRUE;
}
return FALSE;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment