Commit a51a50e0 authored by catch's avatar catch
Browse files

Issue #2962088 by yogeshmpawar, jvsouto, Rassoni, Prashant.c,...

Issue #2962088 by yogeshmpawar, jvsouto, Rassoni, Prashant.c, bhanuprakashnani, quietone, cilefen, longwave, drumm, smustgrave: Convert drupal.org to example.com in tests

(cherry picked from commit dd5a5b71)
parent afa6dc6a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -375,16 +375,16 @@ function (ConstraintViolation $v) {
    // Wrap the existing drupal-media tag with a div and an a that include
    // attributes allowed via GHS.
    $original_value = $this->host->body->value;
    $this->host->body->value = '<div data-bar="baz"><a href="https://drupal.org" data-foo="bar">' . $original_value . '</a></div>';
    $this->host->body->value = '<div data-bar="baz"><a href="https://example.com" data-foo="bar">' . $original_value . '</a></div>';
    $this->host->save();
    $this->drupalGet($this->host->toUrl('edit-form'));

    // Confirm data-foo is present in the editing view.
    $this->assertNotEmpty($link = $assert_session->waitForElementVisible('css', 'a[href="https://drupal.org"]'));
    $this->assertNotEmpty($link = $assert_session->waitForElementVisible('css', 'a[href="https://example.com"]'));
    $this->assertEquals('bar', $link->getAttribute('data-foo'));

    // Confirm that the media is wrapped by the div on the editing view.
    $assert_session->elementExists('css', 'div[data-bar="baz"] > .drupal-media > a[href="https://drupal.org"] > div[data-drupal-media-preview]');
    $assert_session->elementExists('css', 'div[data-bar="baz"] > .drupal-media > a[href="https://example.com"] > div[data-drupal-media-preview]');

    // Confirm that drupal-media is wrapped by the div and a, and that GHS has
    // retained arbitrary HTML allowed by source editing.
@@ -638,12 +638,12 @@ public function testEditableCaption() {
    $this->pressEditorButton('Link');
    $this->assertVisibleBalloon('.ck-link-form');
    $link_input = $page->find('css', '.ck-balloon-panel .ck-link-form input[type=text]');
    $link_input->setValue('https://drupal.org');
    $link_input->setValue('https://example.com');
    $page->find('css', '.ck-balloon-panel .ck-link-form button[type=submit]')->click();
    $this->assertNotEmpty($assert_session->waitForElement('css', '.drupal-media figcaption > a'));
    $this->assertEquals('<a class="ck-link_selected" href="https://drupal.org">Llamas are the most awesome ever</a>', $figcaption->getHtml());
    $this->assertEquals('<a class="ck-link_selected" href="https://example.com">Llamas are the most awesome ever</a>', $figcaption->getHtml());
    $editor_dom = $this->getEditorDataAsDom();
    $this->assertEquals('<a href="https://drupal.org">Llamas are the most awesome ever</a>', $editor_dom->getElementsByTagName('drupal-media')->item(0)->getAttribute('data-caption'));
    $this->assertEquals('<a href="https://example.com">Llamas are the most awesome ever</a>', $editor_dom->getElementsByTagName('drupal-media')->item(0)->getAttribute('data-caption'));
  }

  /**
+1 −1
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ protected function createDefaultContent($num_articles, $num_tags, $article_has_i
      // Make sure that there is at least 1 https link for ::testRead() #19.
      $this->nodes[0]->field_link = [
        'title' => 'Drupal',
        'uri' => 'https://drupal.org',
        'uri' => 'https://example.com',
      ];
      $this->nodes[0]->save();
    }
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ protected function providerTestFieldUI() {
      DRUPAL_OPTIONAL,
    ];
    $link_types = [
      LinkItemInterface::LINK_EXTERNAL => 'http://drupal.org',
      LinkItemInterface::LINK_EXTERNAL => 'http://example.com',
      LinkItemInterface::LINK_GENERIC => '',
      LinkItemInterface::LINK_INTERNAL => '<front>',
    ];
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ protected function setUp($import_test_views = TRUE, $modules = ['link_test_views
  public function testLinkViewsTokens() {
    // Array of URI's to test.
    $uris = [
      'http://www.drupal.org' => 'Drupal.org',
      'http://www.example.com' => 'example.com',
    ];

    // Add nodes with the URI's and titles.
+2 −2
Original line number Diff line number Diff line
@@ -67,12 +67,12 @@ public function testLinkFieldFormStates(string $uri, string $title) {
  public function linkFieldFormStatesData() {
    return [
      'Fill uri, keep title empty' => [
        'https://drupal.org',
        'https://example.com',
        '',
      ],
      'Fill title, keep uri empty' => [
        '',
        'https://drupal.org',
        'https://example.com',
      ],
    ];
  }
Loading