function HtmlTest::testTransformRootRelativeUrlsToAbsolute

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testTransformRootRelativeUrlsToAbsolute()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testTransformRootRelativeUrlsToAbsolute()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testTransformRootRelativeUrlsToAbsolute()

@covers ::transformRootRelativeUrlsToAbsolute @dataProvider providerTestTransformRootRelativeUrlsToAbsolute

File

core/tests/Drupal/Tests/Component/Utility/HtmlTest.php, line 348

Class

HtmlTest
Tests <a href="/api/drupal/core%21lib%21Drupal%21Component%21Utility%21Html.php/class/Html/10" title="Provides DOMDocument helpers for parsing and serializing HTML strings." class="local">\Drupal\Component\Utility\Html</a>.

Namespace

Drupal\Tests\Component\Utility

Code

public function testTransformRootRelativeUrlsToAbsolute($html, $scheme_and_host, $expected_html) : void {
    $this->assertSame($expected_html ?: $html, Html::transformRootRelativeUrlsToAbsolute($html, $scheme_and_host));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.