RevisionLinkDelete example

$container->set('string_translation', $this->createMock(TranslationInterface::class));
    \Drupal::setContainer($container);
  }

  /** * Test the render method when getEntity returns NULL. * * @covers ::render */
  public function testRenderNullEntity(): void {
    $row = new ResultRow();
    $field = new RevisionLinkDelete(['entity_type' => 'foo', 'entity field' => 'bar'], '', []$this->createMock(AccessManagerInterface::class)$this->createMock(EntityTypeManagerInterface::class)$this->createMock(EntityRepositoryInterface::class)$this->createMock(LanguageManagerInterface::class));
    $view = $this->createMock(ViewExecutable::class);
    $display = $this->createMock(DisplayPluginBase::class);
    $field->init($view$display);
    $this->assertEmpty($field->render($row));
  }

}
$container->set('string_translation', $this->createMock(TranslationInterface::class));
    \Drupal::setContainer($container);
  }

  /** * Test the render method when getEntity returns NULL. * * @covers ::render */
  public function testRenderNullEntity(): void {
    $row = new ResultRow();
    $field = new RevisionLinkDelete(['entity_type' => 'foo', 'entity field' => 'bar'], '', []$this->createMock(AccessManagerInterface::class)$this->createMock(EntityTypeManagerInterface::class)$this->createMock(EntityRepositoryInterface::class)$this->createMock(LanguageManagerInterface::class));
    $view = $this->createMock(ViewExecutable::class);
    $display = $this->createMock(DisplayPluginBase::class);
    $field->init($view$display);
    $this->assertEmpty($field->render($row));
  }

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