You are here

public function RouterBaseTest::setUp in Drupal 7 to 8/9 Module Upgrader 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/Routing/RouterBaseTest.php, line 18

Class

RouterBaseTest
@group DMU.Routing

Namespace

Drupal\Tests\drupalmoduleupgrader\Unit\Routing

Code

public function setUp() {
  parent::setUp();
  $this->userEdit = new Route('/user/{user}/edit');
  $this->userView = new Route('/user/{user}');
  $this->userRoot = new Route('/user');
  $route_collection = new RouteCollection();
  $route_collection
    ->add('user', $this->userRoot);
  $this->routeProvider = $this
    ->createMock('\\Drupal\\Core\\Routing\\RouteProviderInterface');
  $this->routeProvider
    ->expects($this
    ->any())
    ->method('getRoutesByPattern')
    ->with('/user')
    ->will($this
    ->returnValue($route_collection));
}