You are here

public function UnroutedUrlAssemblerTest::testAssembleWithExternalUrl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest::testAssembleWithExternalUrl()

@covers ::assemble @covers ::buildExternalUrl

@dataProvider providerTestAssembleWithExternalUrl

File

core/tests/Drupal/Tests/Core/Utility/UnroutedUrlAssemblerTest.php, line 84
Contains \Drupal\Tests\Core\Utility\UnroutedUrlAssemblerTest.

Class

UnroutedUrlAssemblerTest
@coversDefaultClass \Drupal\Core\Utility\UnroutedUrlAssembler @group Utility

Namespace

Drupal\Tests\Core\Utility

Code

public function testAssembleWithExternalUrl($uri, array $options, $expected) {
  $this
    ->setupRequestStack(FALSE);
  $this
    ->assertEquals($expected, $this->unroutedUrlAssembler
    ->assemble($uri, $options));
  $generated_url = $this->unroutedUrlAssembler
    ->assemble($uri, $options, TRUE);
  $this
    ->assertEquals($expected, $generated_url
    ->getGeneratedUrl());
  $this
    ->assertInstanceOf('\\Drupal\\Core\\Render\\BubbleableMetadata', $generated_url);
}