You are here

public function RouterTest::testUrlGeneratorFront in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Routing/RouterTest.php \Drupal\system\Tests\Routing\RouterTest::testUrlGeneratorFront()

Checks the generate method on the url generator using the front router.

File

core/modules/system/src/Tests/Routing/RouterTest.php, line 195
Contains \Drupal\system\Tests\Routing\RouterTest.

Class

RouterTest
Functional class for the full integrated routing system.

Namespace

Drupal\system\Tests\Routing

Code

public function testUrlGeneratorFront() {
  $front_url = Url::fromRoute('<front>', [], [
    'absolute' => TRUE,
  ]);

  // Compare to the site base URL.
  $base_url = Url::fromUri('base:/', [
    'absolute' => TRUE,
  ]);
  $this
    ->assertIdentical($base_url
    ->toString(), $front_url
    ->toString());
}