function UrlTest::testGetUriForProtocolRelativeUrl
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForProtocolRelativeUrl()
- 10 core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForProtocolRelativeUrl()
- 11.x core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForProtocolRelativeUrl()
Tests the getUri() and isExternal() methods for protocol-relative URLs.
@covers ::getUri @covers ::isExternal
File
-
core/
tests/ Drupal/ Tests/ Core/ UrlTest.php, line 338
Class
- UrlTest
- @coversDefaultClass \Drupal\Core\Url @group UrlTest
Namespace
Drupal\Tests\CoreCode
public function testGetUriForProtocolRelativeUrl() {
$url = Url::fromUri('//example.com/test');
$this->assertEquals('//example.com/test', $url->getUri());
$this->assertTrue($url->isExternal());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.