You are here

protected function TestFillPdfTrait::configureFillPdfServiceBackend in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Traits/TestFillPdfTrait.php \Drupal\Tests\fillpdf\Traits\TestFillPdfTrait::configureFillPdfServiceBackend()

Configures the FillPdf service backend.

Parameters

string $api_key: An API key.

string $api_endpoint: (optional) An API endpoint. Defaults to 'https://www.fillpdf.io'.

File

tests/src/Traits/TestFillPdfTrait.php, line 77

Class

TestFillPdfTrait
Provides methods for testing FillPdf.

Namespace

Drupal\Tests\fillpdf\Traits

Code

protected function configureFillPdfServiceBackend($api_key, $api_endpoint = 'https://www.fillpdf.io') {

  // Configure FillPDF Service.
  $edit = [
    'template_scheme' => 'public',
    'backend' => 'fillpdf_service_v2',
    'fillpdf_service_api_key' => $api_key,
    'fillpdf_service_api_endpoint' => $api_endpoint,
  ];
  $this
    ->drupalPostForm('admin/config/media/fillpdf', $edit, t('Save configuration'));
}