protected function FillPdfMergeTestCase::backendTest in FillPDF 7
Tests PDF merging.
2 calls to FillPdfMergeTestCase::backendTest()
- FillPdfMergeTestCase::testLocalServicePdfMerging in tests/
FillPdfMergeTestCase.test - Tests PDF merging using a local service.
- FillPdfMergeTestCase::testPdftkPdfMerging in tests/
FillPdfMergeTestCase.test - Tests PDF merging using a local install of pdftk.
File
- tests/
FillPdfMergeTestCase.test, line 594
Class
- FillPdfMergeTestCase
- Tests that PDF population and token replacement works.
Code
protected function backendTest() {
$this
->uploadTestPdf();
$fillpdf_form = fillpdf_load($this
->getLatestFillPdfForm());
// Get the field definitions for the form that was created and configure
// them.
$fields = fillpdf_get_fields($fillpdf_form->fid);
$this
->assertFalse(empty($fields), 'PDF contained actual fields.');
$this
->mapFillPdfFieldsToEntityFields('node', $fields, $fillpdf_form->fid);
// Hit the generation callback, and check the results from merging.
$this
->drupalGet('fillpdf', array(
'query' => array(
'fid' => $fillpdf_form->fid,
'nid' => $this->testNode->nid,
),
));
$maybe_pdf = $this
->drupalGetContent();
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$this
->assertEqual('application/pdf', $finfo
->buffer($maybe_pdf));
}