You are here

public function PdfPopulationTest::testMergeLocalService in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/PdfPopulationTest.php \Drupal\Tests\fillpdf\Functional\PdfPopulationTest::testMergeLocalService()

Tests PDF population using local service.

Throws

\Behat\Mink\Exception\ResponseTextException Thrown when test had to be skipped as FillPDF LocalServer is not available.

See also

\Drupal\Tests\fillpdf\Traits\TestFillPdfTrait::configureLocalServiceBackend()

File

tests/src/Functional/PdfPopulationTest.php, line 304

Class

PdfPopulationTest
Tests Core entity population and image stamping.

Namespace

Drupal\Tests\fillpdf\Functional

Code

public function testMergeLocalService() {

  // For local container testing, we require the Docker container to be
  // running. If LocalServer's /ping endpoint does not return a 200, we assume
  // that we're not in an environment where we can run this
  // test.
  $this
    ->configureLocalServiceBackend();
  $config = $this->container
    ->get('config.factory')
    ->get('fillpdf.settings');
  if (!FillPdf::checkLocalServiceEndpoint($this->container
    ->get('http_client'), $config)) {
    $this
      ->markTestSkipped('FillPDF LocalServer unavailable, so skipping test.');
  }
  $this
    ->backendTest();
}