function UrlTest::setUpMockUrlGenerator

Reinitializes the URL generator as a mock object.

1 call to UrlTest::setUpMockUrlGenerator()
UrlTest::testInvalidEntityUriParameter in core/tests/Drupal/Tests/Core/UrlTest.php
Tests the fromUri() method with an invalid entity: URI.

File

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

Class

UrlTest
Tests Drupal\Core\Url.

Namespace

Drupal\Tests\Core

Code

protected function setUpMockUrlGenerator() : void {
  $this->urlGenerator = $this->createMock(UrlGeneratorInterface::class);
  $this->container
    ->set('url_generator', $this->urlGenerator);
}

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