Skip to content
Snippets Groups Projects
Verified Commit 60ce3e07 authored by Dave Long's avatar Dave Long
Browse files

Issue #3376941 by acbramley, kingdutch: Replace usage of generateString with...

Issue #3376941 by acbramley, kingdutch: Replace usage of generateString with generate in NodeRSSContentTest
parent c84246a8
No related branches found
No related tags found
2 merge requests!3478Issue #3337882: Deleted menus are not removed from content type config,!579Issue #2230909: Simple decimals fail to pass validation
Pipeline #475634 passed with warnings
Pipeline: drupal

#475649

    Pipeline: drupal

    #475647

      Pipeline: drupal

      #475644

        +4
        ......@@ -96,18 +96,18 @@ public function testUrlHandling(): void {
        $file_url_generator = \Drupal::service('file_url_generator');
        $this->drupalCreateNode($defaults + [
        'body' => [
        'value' => '<p><a href="' . $file_url_generator->generateString('public://root-relative') . '">Root-relative URL</a></p>',
        'value' => '<p><a href="' . $file_url_generator->generate('public://root-relative')->toString() . '">Root-relative URL</a></p>',
        'format' => 'full_html',
        ],
        ]);
        $protocol_relative_url = substr($file_url_generator->generateAbsoluteString('public://protocol-relative'), strlen(\Drupal::request()->getScheme() . ':'));
        $protocol_relative_url = substr($file_url_generator->generate('public://protocol-relative')->setAbsolute()->toString(), strlen(\Drupal::request()->getScheme() . ':'));
        $this->drupalCreateNode($defaults + [
        'body' => [
        'value' => '<p><a href="' . $protocol_relative_url . '">Protocol-relative URL</a></p>',
        'format' => 'full_html',
        ],
        ]);
        $absolute_url = $file_url_generator->generateAbsoluteString('public://absolute');
        $absolute_url = $file_url_generator->generate('public://absolute')->setAbsolute()->toString();
        $this->drupalCreateNode($defaults + [
        'body' => [
        'value' => '<p><a href="' . $absolute_url . '">Absolute URL</a></p>',
        ......@@ -117,7 +117,7 @@ public function testUrlHandling(): void {
        $this->drupalGet('rss.xml');
        // Verify that root-relative URL is transformed to absolute.
        $this->assertSession()->responseContains($file_url_generator->generateAbsoluteString('public://root-relative'));
        $this->assertSession()->responseContains($file_url_generator->generate('public://root-relative')->setAbsolute()->toString());
        // Verify that protocol-relative URL is left untouched.
        $this->assertSession()->responseContains($protocol_relative_url);
        // Verify that absolute URL is left untouched.
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment