Skip to content
Snippets Groups Projects
Commit a85c80fa authored by Jess's avatar Jess
Browse files

Issue #2575599 by jaredsmith, joshi.rohit100, dawehner, xjm, alexpott, plach,...

Issue #2575599 by jaredsmith, joshi.rohit100, dawehner, xjm, alexpott, plach, Berdir, Sutharsan, borisson_, justAChris, stefan.r, joelpittet, Ryan Weal: Remove !placeholder in ContactPersonalTest and Drupal\migrate\Plugin\migrate\id_map\Sql
parent e8b5f468
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace Drupal\contact\Tests; namespace Drupal\contact\Tests;
use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Utility\PlainTextOutput;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\simpletest\WebTestBase; use Drupal\simpletest\WebTestBase;
use Drupal\user\RoleInterface; use Drupal\user\RoleInterface;
...@@ -79,12 +80,13 @@ function testSendPersonalContactMessage() { ...@@ -79,12 +80,13 @@ function testSendPersonalContactMessage() {
$this->assertEqual($mail['reply-to'], $this->webUser->getEmail()); $this->assertEqual($mail['reply-to'], $this->webUser->getEmail());
$this->assertEqual($mail['key'], 'user_mail'); $this->assertEqual($mail['key'], 'user_mail');
$variables = array( $variables = array(
'!site-name' => $this->config('system.site')->get('name'), '@site-name' => $this->config('system.site')->get('name'),
'!subject' => $message['subject[0][value]'], '@subject' => $message['subject[0][value]'],
'!recipient-name' => $this->contactUser->getUsername(), '@recipient-name' => $this->contactUser->getUsername(),
); );
$this->assertEqual($mail['subject'], t('[!site-name] !subject', $variables), 'Subject is in sent message.'); $subject = PlainTextOutput::renderFromHtml(t('[@site-name] @subject', $variables));
$this->assertTrue(strpos($mail['body'], 'Hello ' . $variables['!recipient-name']) !== FALSE, 'Recipient name is in sent message.'); $this->assertEqual($mail['subject'], $subject, 'Subject is in sent message.');
$this->assertTrue(strpos($mail['body'], 'Hello ' . $variables['@recipient-name']) !== FALSE, 'Recipient name is in sent message.');
$this->assertTrue(strpos($mail['body'], $this->webUser->getUsername()) !== FALSE, 'Sender name is in sent message.'); $this->assertTrue(strpos($mail['body'], $this->webUser->getUsername()) !== FALSE, 'Sender name is in sent message.');
$this->assertTrue(strpos($mail['body'], $message['message[0][value]']) !== FALSE, 'Message body is in sent message.'); $this->assertTrue(strpos($mail['body'], $message['message[0][value]']) !== FALSE, 'Message body is in sent message.');
......
...@@ -507,8 +507,8 @@ public function saveIdMapping(Row $row, array $destination_id_values, $source_ro ...@@ -507,8 +507,8 @@ public function saveIdMapping(Row $row, array $destination_id_values, $source_ro
// A NULL key value will fail. // A NULL key value will fail.
if (!isset($source_id_values[$field_name])) { if (!isset($source_id_values[$field_name])) {
$this->message->display(t( $this->message->display(t(
'Could not save to map table due to NULL value for key field !field', 'Could not save to map table due to NULL value for key field @field',
array('!field' => $field_name)), 'error'); array('@field' => $field_name)), 'error');
return; return;
} }
$keys[$key_name] = $source_id_values[$field_name]; $keys[$key_name] = $source_id_values[$field_name];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment