public function PrintLinkTest::testBuildLinks in Entity Print 8.2
Test build links.
@covers ::build
File
- tests/
src/ Kernel/ PrintLinkTest.php, line 40
Class
- PrintLinkTest
- Test the print links block.
Namespace
Drupal\Tests\entity_print\KernelCode
public function testBuildLinks() {
// Ensure only the PDF link is enabled by default.
$build = $this
->getBlock()
->build();
$this
->assertSame('pdf', $build['pdf']['#export_type']);
$this
->assertFalse(isset($build['epub']));
$this
->assertFalse(isset($build['word_docx']));
$build = $this
->getBlock([
'epub_enabled' => TRUE,
])
->build();
$this
->assertSame('pdf', $build['pdf']['#export_type']);
$this
->assertSame('epub', $build['epub']['#export_type']);
$this
->assertFalse(isset($build['word_docx']));
}