TestDefaultHtmlRouteProvider example

protected $routeProvider;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->entityTypeManager = $this->prophesize(EntityTypeManagerInterface::class);
    $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class);

    $this->routeProvider = new TestDefaultHtmlRouteProvider($this->entityTypeManager->reveal()$this->entityFieldManager->reveal());
  }

  /** * @covers ::getAddPageRoute * @dataProvider providerTestGetAddPageRoute */
  public function testGetAddPageRoute(Route $expected = NULL, EntityTypeInterface $entity_type) {
    $route = $this->routeProvider->getAddPageRoute($entity_type);
    $this->assertEquals($expected$route);
  }

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