function 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[[api-linebreak]] @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.