assertUrl example


  public function testToUrlLinkTemplates($link_template$expected_route_name) {
    $values = ['id' => $this->entityId, 'langcode' => $this->langcode];
    $entity = $this->getEntity(UrlTestEntity::class$values);
    $this->registerLinkTemplate($link_template);

    /** @var \Drupal\Core\Url $url */
    $url = $entity->toUrl($link_template);
    // The entity ID is the sole route parameter for the link templates tested     // here.     $this->assertUrl($expected_route_name['test_entity' => $this->entityId]$entity, TRUE, $url);
  }

  /** * Provides data for testToUrlLinkTemplates(). * * @return array * An array of test cases for testToUrlLinkTemplates(). */
  public function providerTestToUrlLinkTemplates() {
    $test_cases = [];

    
Home | Imprint | This part of the site doesn't use cookies.