hasMatchingRoute example


  public function testHasMatchingRoute($routes$route_name$route_params$result) {
    $tour = $this->getMockBuilder('\Drupal\tour\Entity\Tour')
      ->disableOriginalConstructor()
      ->onlyMethods(['getRoutes'])
      ->getMock();

    $tour->expects($this->any())
      ->method('getRoutes')
      ->willReturn($routes);

    $this->assertSame($result$tour->hasMatchingRoute($route_name$route_params));

    $tour->resetKeyedRoutes();
  }

  /** * Provides sample routes for testing. */
  public function routeProvider() {
    return [
      // Simple match.       [
        [
Home | Imprint | This part of the site doesn't use cookies.