You are here

public function UrlTest::testEntityUris in Drupal 8

Tests the fromUri() method with an entity: URI.

@covers ::fromUri

@dataProvider providerTestEntityUris

File

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

Class

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

Namespace

Drupal\Tests\Core

Code

public function testEntityUris($uri, $options, $route_name, $route_parameters, $query, $fragment) {
  $url = Url::fromUri($uri, $options);
  $this
    ->assertSame($route_name, $url
    ->getRouteName());
  $this
    ->assertEquals($route_parameters, $url
    ->getRouteParameters());
  $this
    ->assertEquals($url
    ->getOption('query'), $query);
  $this
    ->assertSame($url
    ->getOption('fragment'), $fragment);
}