Verified Commit 30f6f4bb authored by Dave Long's avatar Dave Long
Browse files

Issue #3403573 by quietone: Fix attribute related words in tests

(cherry picked from commit db720e3e)
parent 0e430f2a
Loading
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -161,7 +161,6 @@ classtype
cldr
clearfix
clicksorter
clist
closethick
cnenzrgre
codesniffer
@@ -824,7 +823,6 @@ sloopal
smacss
smalldatetime
somecompany
somelinks
sortablejs
sourceediting
spacebar
@@ -921,7 +919,6 @@ tcomment
templating
tercera
testajax
testattribute
testblock
testbody
testbot
+3 −3
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ protected function setUp(): void {
        'filter_html' => [
          'status' => 1,
          'settings' => [
            'allowed_html' => '<img src testattribute> <a>',
            'allowed_html' => '<img src test-attribute> <a>',
          ],
        ],
        'filter_autop' => [
@@ -134,7 +134,7 @@ public function testImageSource() {
      $comment[] = $image . ':';
      // Hash the image source in a custom test attribute, because it might
      // contain characters that confuse XPath.
      $comment[] = '<img src="' . $image . '" testattribute="' . hash('sha256', $image) . '" />';
      $comment[] = '<img src="' . $image . '" test-attribute="' . hash('sha256', $image) . '" />';
    }
    $edit = [
      'comment_body[0][value]' => implode("\n", $comment),
@@ -143,7 +143,7 @@ public function testImageSource() {
    $this->submitForm($edit, 'Save');
    foreach ($images as $image => $converted) {
      $found = FALSE;
      foreach ($this->xpath('//img[@testattribute="' . hash('sha256', $image) . '"]') as $element) {
      foreach ($this->xpath('//img[@test-attribute="' . hash('sha256', $image) . '"]') as $element) {
        $found = TRUE;
        if ($converted == $red_x_image) {
          $this->assertEquals($red_x_image, $element->getAttribute('src'));
+10 −10
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public function testItemList() {
      [
        '#markup' => 'c',
        'child_list' => [
          '#attributes' => ['id' => 'clist'],
          '#attributes' => ['id' => 'c-list'],
          'ca',
          [
            '#markup' => 'cb',
@@ -155,7 +155,7 @@ public function testItemList() {
    $inner_cb .= '<li>cbb</li>';
    $inner_cb .= '</ul></div>';

    $inner_c = '<div class="item-list"><ul id="clist">';
    $inner_c = '<div class="item-list"><ul id="c-list">';
    $inner_c .= '<li>ca</li>';
    $inner_c .= '<li class="item-class-cb">cb' . $inner_cb . '</li>';
    $inner_c .= '<li>cc</li>';
@@ -196,7 +196,7 @@ public function testLinks() {

    // Verify that a list of links is properly rendered.
    $variables = [];
    $variables['attributes'] = ['id' => 'somelinks'];
    $variables['attributes'] = ['id' => 'some_links'];
    $variables['links'] = [
      'a link' => [
        'title' => 'A <link>',
@@ -226,7 +226,7 @@ public function testLinks() {
    ];

    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li>' . Html::escape('Plain "text"') . '</li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
@@ -266,7 +266,7 @@ public function testLinks() {
      'class' => ['a/class'],
    ];
    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
@@ -282,7 +282,7 @@ public function testLinks() {
    \Drupal::currentUser()->setAccount(new UserSession(['uid' => 1]));
    $variables['set_active_class'] = TRUE;
    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
@@ -317,7 +317,7 @@ public function testIndexedKeyedLinks() {

    // Verify that a list of links is properly rendered.
    $variables = [];
    $variables['attributes'] = ['id' => 'somelinks'];
    $variables['attributes'] = ['id' => 'some_links'];
    $variables['links'] = [
      [
        'title' => 'A <link>',
@@ -347,7 +347,7 @@ public function testIndexedKeyedLinks() {
    ];

    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li>' . Html::escape('Plain "text"') . '</li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
@@ -387,7 +387,7 @@ public function testIndexedKeyedLinks() {
      'class' => ['a/class'],
    ];
    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';
@@ -403,7 +403,7 @@ public function testIndexedKeyedLinks() {
    \Drupal::currentUser()->setAccount(new UserSession(['uid' => 1]));
    $variables['set_active_class'] = TRUE;
    $expected_links = '';
    $expected_links .= '<ul id="somelinks">';
    $expected_links .= '<ul id="some_links">';
    $expected_links .= '<li><a href="' . Url::fromUri('base:a/link')->toString() . '">' . Html::escape('A <link>') . '</a></li>';
    $expected_links .= '<li><span class="a/class">' . Html::escape('Plain "text"') . '</span></li>';
    $expected_links .= '<li><span class="unescaped">' . Html::escape('potentially unsafe text that <should> be escaped') . '</span></li>';