Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
@ -178,6 +178,10 @@ trait AssertContentTrait {
|
|||
protected function buildXPathQuery($xpath, array $args = array()) {
|
||||
// Replace placeholders.
|
||||
foreach ($args as $placeholder => $value) {
|
||||
// Cast MarkupInterface objects to string.
|
||||
if (is_object($value)) {
|
||||
$value = (string) $value;
|
||||
}
|
||||
// XPath 1.0 doesn't support a way to escape single or double quotes in a
|
||||
// string literal. We split double quotes out of the string, and encode
|
||||
// them separately.
|
||||
|
@ -281,7 +285,7 @@ trait AssertContentTrait {
|
|||
*
|
||||
* An optional link index may be passed.
|
||||
*
|
||||
* @param string $label
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $label
|
||||
* Text between the anchor tags.
|
||||
* @param int $index
|
||||
* Link position counting from zero.
|
||||
|
@ -299,6 +303,8 @@ trait AssertContentTrait {
|
|||
* TRUE if the assertion succeeded, FALSE otherwise.
|
||||
*/
|
||||
protected function assertLink($label, $index = 0, $message = '', $group = 'Other') {
|
||||
// Cast MarkupInterface objects to string.
|
||||
$label = (string) $label;
|
||||
$links = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
|
||||
$message = ($message ? $message : strtr('Link with label %label found.', array('%label' => $label)));
|
||||
return $this->assert(isset($links[$index]), $message, $group);
|
||||
|
@ -307,12 +313,13 @@ trait AssertContentTrait {
|
|||
/**
|
||||
* Passes if a link with the specified label is not found.
|
||||
*
|
||||
* @param string $label
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $label
|
||||
* Text between the anchor tags.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -323,6 +330,8 @@ trait AssertContentTrait {
|
|||
* TRUE if the assertion succeeded, FALSE otherwise.
|
||||
*/
|
||||
protected function assertNoLink($label, $message = '', $group = 'Other') {
|
||||
// Cast MarkupInterface objects to string.
|
||||
$label = (string) $label;
|
||||
$links = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label));
|
||||
$message = ($message ? $message : SafeMarkup::format('Link with label %label not found.', array('%label' => $label)));
|
||||
return $this->assert(empty($links), $message, $group);
|
||||
|
@ -337,8 +346,9 @@ trait AssertContentTrait {
|
|||
* Link position counting from zero.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -361,8 +371,9 @@ trait AssertContentTrait {
|
|||
* The full or partial value of the 'href' attribute of the anchor tag.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -385,8 +396,9 @@ trait AssertContentTrait {
|
|||
* The full or partial value of the 'href' attribute of the anchor tag.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -411,8 +423,9 @@ trait AssertContentTrait {
|
|||
* Raw (HTML) string to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -424,7 +437,7 @@ trait AssertContentTrait {
|
|||
*/
|
||||
protected function assertRaw($raw, $message = '', $group = 'Other') {
|
||||
if (!$message) {
|
||||
$message = SafeMarkup::format('Raw "@raw" found', array('@raw' => $raw));
|
||||
$message = 'Raw "' . Html::escape($raw) . '" found';
|
||||
}
|
||||
return $this->assert(strpos($this->getRawContent(), (string) $raw) !== FALSE, $message, $group);
|
||||
}
|
||||
|
@ -438,8 +451,9 @@ trait AssertContentTrait {
|
|||
* Raw (HTML) string to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -451,7 +465,7 @@ trait AssertContentTrait {
|
|||
*/
|
||||
protected function assertNoRaw($raw, $message = '', $group = 'Other') {
|
||||
if (!$message) {
|
||||
$message = SafeMarkup::format('Raw "@raw" not found', array('@raw' => $raw));
|
||||
$message = 'Raw "' . Html::escape($raw) . '" not found';
|
||||
}
|
||||
return $this->assert(strpos($this->getRawContent(), (string) $raw) === FALSE, $message, $group);
|
||||
}
|
||||
|
@ -465,8 +479,9 @@ trait AssertContentTrait {
|
|||
* Raw (HTML) string to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -478,7 +493,7 @@ trait AssertContentTrait {
|
|||
*/
|
||||
protected function assertEscaped($raw, $message = '', $group = 'Other') {
|
||||
if (!$message) {
|
||||
$message = SafeMarkup::format('Escaped "@raw" found', array('@raw' => $raw));
|
||||
$message = 'Escaped "' . Html::escape($raw) . '" found';
|
||||
}
|
||||
return $this->assert(strpos($this->getRawContent(), Html::escape($raw)) !== FALSE, $message, $group);
|
||||
}
|
||||
|
@ -493,8 +508,9 @@ trait AssertContentTrait {
|
|||
* Raw (HTML) string to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -506,7 +522,7 @@ trait AssertContentTrait {
|
|||
*/
|
||||
protected function assertNoEscaped($raw, $message = '', $group = 'Other') {
|
||||
if (!$message) {
|
||||
$message = SafeMarkup::format('Escaped "@raw" not found', array('@raw' => $raw));
|
||||
$message = 'Escaped "' . Html::escape($raw) . '" not found';
|
||||
}
|
||||
return $this->assert(strpos($this->getRawContent(), Html::escape($raw)) === FALSE, $message, $group);
|
||||
}
|
||||
|
@ -521,8 +537,9 @@ trait AssertContentTrait {
|
|||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -548,8 +565,9 @@ trait AssertContentTrait {
|
|||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -574,8 +592,9 @@ trait AssertContentTrait {
|
|||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -602,12 +621,13 @@ trait AssertContentTrait {
|
|||
* through a web browser. In other words the HTML has been filtered out of
|
||||
* the contents.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $text
|
||||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -628,12 +648,13 @@ trait AssertContentTrait {
|
|||
* through a web browser. In other words the HTML has been filtered out of
|
||||
* the contents.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $text
|
||||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -652,12 +673,13 @@ trait AssertContentTrait {
|
|||
*
|
||||
* It is not recommended to call this function directly.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $text
|
||||
* Plain text to look for.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -671,6 +693,8 @@ trait AssertContentTrait {
|
|||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
protected function assertUniqueTextHelper($text, $message = '', $group = 'Other', $be_unique = FALSE) {
|
||||
// Cast MarkupInterface objects to string.
|
||||
$text = (string) $text;
|
||||
if (!$message) {
|
||||
$message = '"' . $text . '"' . ($be_unique ? ' found only once' : ' found more than once');
|
||||
}
|
||||
|
@ -690,8 +714,9 @@ trait AssertContentTrait {
|
|||
* Perl regex to look for including the regex delimiters.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -715,8 +740,9 @@ trait AssertContentTrait {
|
|||
* Perl regex to look for including the regex delimiters.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -763,8 +789,9 @@ trait AssertContentTrait {
|
|||
* The string the title should be.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -779,6 +806,8 @@ trait AssertContentTrait {
|
|||
preg_match('@<title>(.*)</title>@', $this->getRawContent(), $matches);
|
||||
if (isset($matches[1])) {
|
||||
$actual = $matches[1];
|
||||
$actual = $this->castSafeStrings($actual);
|
||||
$title = $this->castSafeStrings($title);
|
||||
if (!$message) {
|
||||
$message = SafeMarkup::format('Page title @actual is equal to @expected.', array(
|
||||
'@actual' => var_export($actual, TRUE),
|
||||
|
@ -797,8 +826,9 @@ trait AssertContentTrait {
|
|||
* The string the title should not be.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -830,8 +860,9 @@ trait AssertContentTrait {
|
|||
* The expected themed output string.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -846,7 +877,7 @@ trait AssertContentTrait {
|
|||
$renderer = \Drupal::service('renderer');
|
||||
|
||||
// The string cast is necessary because theme functions return
|
||||
// SafeStringInterface objects. This means we can assert that $expected
|
||||
// MarkupInterface objects. This means we can assert that $expected
|
||||
// matches the theme output without having to worry about 0 == ''.
|
||||
$output = (string) $renderer->executeInRenderContext(new RenderContext(), function() use ($callback, $variables) {
|
||||
return \Drupal::theme()->render($callback, $variables);
|
||||
|
@ -873,8 +904,9 @@ trait AssertContentTrait {
|
|||
* checking the actual value, while still checking that the field exists.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -930,8 +962,9 @@ trait AssertContentTrait {
|
|||
* exists.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -980,8 +1013,9 @@ trait AssertContentTrait {
|
|||
* page does not match it.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1020,8 +1054,9 @@ trait AssertContentTrait {
|
|||
* exists.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1060,8 +1095,9 @@ trait AssertContentTrait {
|
|||
* default value ('') asserts that the field value is not an empty string.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1080,15 +1116,16 @@ trait AssertContentTrait {
|
|||
*
|
||||
* @param string $id
|
||||
* ID of field to assert.
|
||||
* @param string $value
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $value
|
||||
* (optional) Value for the field to assert. You may pass in NULL to skip
|
||||
* checking the value, while still checking that the field exists.
|
||||
* However, the default value ('') asserts that the field value is an empty
|
||||
* string.
|
||||
* @param string $message
|
||||
* @param string|\Drupal\Component\Render\MarkupInterface $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1099,6 +1136,11 @@ trait AssertContentTrait {
|
|||
* TRUE on pass, FALSE on fail.
|
||||
*/
|
||||
protected function assertFieldById($id, $value = '', $message = '', $group = 'Browser') {
|
||||
// Cast MarkupInterface objects to string.
|
||||
if (isset($value)) {
|
||||
$value = (string) $value;
|
||||
}
|
||||
$message = (string) $message;
|
||||
return $this->assertFieldByXPath($this->constructFieldXpath('id', $id), $value, $message ? $message : SafeMarkup::format('Found field by id @id', array('@id' => $id)), $group);
|
||||
}
|
||||
|
||||
|
@ -1114,8 +1156,9 @@ trait AssertContentTrait {
|
|||
* value ('') asserts that the field value is not an empty string.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1136,8 +1179,9 @@ trait AssertContentTrait {
|
|||
* ID of field to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1159,8 +1203,9 @@ trait AssertContentTrait {
|
|||
* ID of field to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1184,8 +1229,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1209,8 +1255,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1234,8 +1281,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1260,8 +1308,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1287,8 +1336,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1314,8 +1364,9 @@ trait AssertContentTrait {
|
|||
* Option to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1337,8 +1388,9 @@ trait AssertContentTrait {
|
|||
* Name or ID of field to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1359,8 +1411,9 @@ trait AssertContentTrait {
|
|||
* Name or ID of field to assert.
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
@ -1379,8 +1432,9 @@ trait AssertContentTrait {
|
|||
*
|
||||
* @param string $message
|
||||
* (optional) A message to display with the assertion. Do not translate
|
||||
* messages: use format_string() to embed variables in the message text, not
|
||||
* t(). If left blank, a default message will be displayed.
|
||||
* messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
|
||||
* variables in the message text, not t(). If left blank, a default message
|
||||
* will be displayed.
|
||||
* @param string $group
|
||||
* (optional) The group this message is in, which is displayed in a column
|
||||
* in test output. Use 'Debug' to indicate this is debugging output. Do not
|
||||
|
|
Reference in a new issue