You are here

protected function FillPdfTestBase::setUp in FillPDF 8.4

Same name and namespace in other branches
  1. 5.0.x tests/src/Functional/FillPdfTestBase.php \Drupal\Tests\fillpdf\Functional\FillPdfTestBase::setUp()

Overrides FileFieldTestBase::setUp

4 calls to FillPdfTestBase::setUp()
FillPdfFormFormTest::setUp in tests/src/Functional/FillPdfFormFormTest.php
HandlePdfControllerTest::setUp in tests/src/Functional/HandlePdfControllerTest.php
PdfPopulationTest::setUp in tests/src/Functional/PdfPopulationTest.php
PdfWebformPopulationTest::setUp in tests/src/Functional/PdfWebformPopulationTest.php
4 methods override FillPdfTestBase::setUp()
FillPdfFormFormTest::setUp in tests/src/Functional/FillPdfFormFormTest.php
HandlePdfControllerTest::setUp in tests/src/Functional/HandlePdfControllerTest.php
PdfPopulationTest::setUp in tests/src/Functional/PdfPopulationTest.php
PdfWebformPopulationTest::setUp in tests/src/Functional/PdfWebformPopulationTest.php

File

tests/src/Functional/FillPdfTestBase.php, line 104

Class

FillPdfTestBase
Base class that can be inherited by FillPDF tests.

Namespace

Drupal\Tests\fillpdf\Functional

Code

protected function setUp() {
  parent::setUp();

  // Grant additional permissions to the logged-in admin user.
  $existing_user_roles = $this->adminUser
    ->getRoles(TRUE);
  $role_to_modify = Role::load(end($existing_user_roles));
  $this
    ->grantPermissions($role_to_modify, [
    'administer pdfs',
    'create article content',
    'edit any article content',
    'delete any article content',
  ]);
  $this->testImage = $this
    ->getTestFile('image');
  $this
    ->configureFillPdf();
  $this->backendServiceManager = $this->container
    ->get('plugin.manager.fillpdf_backend_service');
  $this->linkManipulator = $this->container
    ->get('fillpdf.link_manipulator');
}