function UrlTest::testGetUriForInternalUrl

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForInternalUrl()
  2. 10 core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForInternalUrl()
  3. 9 core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForInternalUrl()
  4. 8.9.x core/tests/Drupal/Tests/Core/UrlTest.php \Drupal\Tests\Core\UrlTest::testGetUriForInternalUrl()

Tests the getUri() method for internal URLs.

Attributes

#[Depends('testUrlFromRequest')]

Parameters

\Drupal\Core\Url[] $urls: Array of URL objects.

File

core/tests/Drupal/Tests/Core/UrlTest.php, line 291

Class

UrlTest
Tests Drupal\Core\Url.

Namespace

Drupal\Tests\Core

Code

public function testGetUriForInternalUrl($urls) : void {
  $this->expectException(\UnexpectedValueException::class);
  foreach ($urls as $url) {
    $url->getUri();
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.