Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/contact/tests/src/Functional/ContactPersonalTest.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
63 /** | 63 /** |
64 * Tests that mails for contact messages are correctly sent. | 64 * Tests that mails for contact messages are correctly sent. |
65 */ | 65 */ |
66 public function testSendPersonalContactMessage() { | 66 public function testSendPersonalContactMessage() { |
67 // Ensure that the web user's email needs escaping. | 67 // Ensure that the web user's email needs escaping. |
68 $mail = $this->webUser->getUsername() . '&escaped@example.com'; | 68 $mail = $this->webUser->getAccountName() . '&escaped@example.com'; |
69 $this->webUser->setEmail($mail)->save(); | 69 $this->webUser->setEmail($mail)->save(); |
70 $this->drupalLogin($this->webUser); | 70 $this->drupalLogin($this->webUser); |
71 | 71 |
72 $this->drupalGet('user/' . $this->contactUser->id() . '/contact'); | 72 $this->drupalGet('user/' . $this->contactUser->id() . '/contact'); |
73 $this->assertEscaped($mail); | 73 $this->assertEscaped($mail); |
96 // Verify that the correct watchdog message has been logged. | 96 // Verify that the correct watchdog message has been logged. |
97 $this->drupalGet('/admin/reports/dblog'); | 97 $this->drupalGet('/admin/reports/dblog'); |
98 $placeholders = [ | 98 $placeholders = [ |
99 '@sender_name' => $this->webUser->username, | 99 '@sender_name' => $this->webUser->username, |
100 '@sender_email' => $this->webUser->getEmail(), | 100 '@sender_email' => $this->webUser->getEmail(), |
101 '@recipient_name' => $this->contactUser->getUsername(), | 101 '@recipient_name' => $this->contactUser->getAccountName(), |
102 ]; | 102 ]; |
103 $this->assertRaw(new FormattableMarkup('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders)); | 103 $this->assertRaw(new FormattableMarkup('@sender_name (@sender_email) sent @recipient_name an email.', $placeholders)); |
104 // Ensure an unescaped version of the email does not exist anywhere. | 104 // Ensure an unescaped version of the email does not exist anywhere. |
105 $this->assertNoRaw($this->webUser->getEmail()); | 105 $this->assertNoRaw($this->webUser->getEmail()); |
106 } | 106 } |