You are here

public function UrlGeneratorTest::testNoPath in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php \Drupal\Tests\Core\Routing\UrlGeneratorTest::testNoPath()

Tests generating a relative URL with no path.

@covers ::generateFromRoute

@dataProvider providerTestNoPath

Parameters

array $options: An array of URL options.

string $expected_url: The expected relative URL.

File

core/tests/Drupal/Tests/Core/Routing/UrlGeneratorTest.php, line 483

Class

UrlGeneratorTest
Confirm that the UrlGenerator is functioning properly.

Namespace

Drupal\Tests\Core\Routing

Code

public function testNoPath($options, $expected_url) {
  $url = $this->generator
    ->generateFromRoute('<none>', [], $options);
  $this
    ->assertEquals($expected_url, $url);
}