You are here

public function UrlTest::testGetRouteNameWithExternalUrl in Drupal 8

Tests the getRouteName() with an external URL.

@covers ::getRouteName

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 420
Contains \Drupal\Tests\Core\UrlTest.

Class

UrlTest
@coversDefaultClass \Drupal\Core\Url @group UrlTest

Namespace

Drupal\Tests\Core

Code

public function testGetRouteNameWithExternalUrl() {
  $url = Url::fromUri('http://example.com');
  $this
    ->expectException(\UnexpectedValueException::class);
  $url
    ->getRouteName();
}