registerBundleInfo example


  public function testToUrlUriCallbackUndefined(array $bundle_info$uri_callback) {
    $entity = $this->getEntity(UrlTestEntity::class['id' => $this->entityId]);

    $this->registerBundleInfo($bundle_info);
    $this->entityType->getUriCallback()->willReturn($uri_callback);

    $link_template = 'canonical';
    $this->expectException(UndefinedLinkTemplateException::class);
    $this->expectExceptionMessage("No link template '$link_template' found for the '$this->entityTypeId' entity type");
    $entity->toUrl($link_template);
  }

  /** * Provides data for testToUrlUriCallbackUndefined(). * * @return array * An array of test cases for testToUrlUriCallbackUndefined(). */
Home | Imprint | This part of the site doesn't use cookies.