You are here

public function PdfPopulationTest::testMergeLocalService in FillPDF 8.4

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

Tests PDF population using local service.

Throws

\PHPUnit_Framework_SkippedTestError

\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 337

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)) {
    throw new \PHPUnit_Framework_SkippedTestError('FillPDF LocalServer unavailable, so skipping test.');
  }
  $this
    ->backendTest();
}