Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / tests / Drupal / Tests / WebAssert.php
index 81495517005b24042a5f4b80631b874efc42715b..19d9c2cc65e8ee1e470bc4e35472bceaa934d4cc 100644 (file)
@@ -115,7 +115,7 @@ class WebAssert extends MinkWebAssert {
     $container = $container ?: $this->session->getPage();
     $node = $container->find('named', [
       'select',
-      $this->session->getSelectorsHandler()->xpathLiteral($select),
+      $select,
     ]);
 
     if ($node === NULL) {
@@ -145,7 +145,7 @@ class WebAssert extends MinkWebAssert {
     $container = $container ?: $this->session->getPage();
     $select_field = $container->find('named', [
       'select',
-      $this->session->getSelectorsHandler()->xpathLiteral($select),
+      $select,
     ]);
 
     if ($select_field === NULL) {
@@ -155,7 +155,7 @@ class WebAssert extends MinkWebAssert {
     $option_field = $select_field->find('named', ['option', $option]);
 
     if ($option_field === NULL) {
-      throw new ElementNotFoundException($this->session, 'select', 'id|name|label|value', $option);
+      throw new ElementNotFoundException($this->session->getDriver(), 'select', 'id|name|label|value', $option);
     }
 
     return $option_field;
@@ -167,7 +167,7 @@ class WebAssert extends MinkWebAssert {
    * @param string $select
    *   One of id|name|label|value for the select field.
    * @param string $option
-   *   The option value that shoulkd not exist.
+   *   The option value that should not exist.
    * @param \Behat\Mink\Element\TraversableElement $container
    *   (optional) The document to check against. Defaults to the current page.
    *
@@ -178,7 +178,7 @@ class WebAssert extends MinkWebAssert {
     $container = $container ?: $this->session->getPage();
     $select_field = $container->find('named', [
       'select',
-      $this->session->getSelectorsHandler()->xpathLiteral($select),
+      $select,
     ]);
 
     if ($select_field === NULL) {
@@ -202,7 +202,7 @@ class WebAssert extends MinkWebAssert {
   public function titleEquals($expected_title) {
     $title_element = $this->session->getPage()->find('css', 'title');
     if (!$title_element) {
-      throw new ExpectationException('No title element found on the page', $this->session);
+      throw new ExpectationException('No title element found on the page', $this->session->getDriver());
     }
     $actual_title = $title_element->getText();
     $this->assert($expected_title === $actual_title, 'Title found');
@@ -305,7 +305,7 @@ class WebAssert extends MinkWebAssert {
    *   Link position counting from zero.
    * @param string $message
    *   (optional) A message to display with the assertion. Do not translate
-   *   messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
+   *   messages: use \Drupal\Component\Render\FormattableMarkup to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
    *
@@ -326,7 +326,7 @@ class WebAssert extends MinkWebAssert {
    *   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 \Drupal\Component\Utility\SafeMarkup::format() to embed
+   *   messages: use \Drupal\Component\Render\FormattableMarkup to embed
    *   variables in the message text, not t(). If left blank, a default message
    *   will be displayed.
    *
@@ -488,7 +488,7 @@ class WebAssert extends MinkWebAssert {
   }
 
   /**
-   * Checks that specific hidden field does not exists.
+   * Checks that specific hidden field does not exist.
    *
    * @param string $field
    *   One of id|name|value for the hidden field.