You are here

public function FillPdfTestCase::testPdfUpload in FillPDF 7

File

tests/FillPdfTestCase.test, line 40

Class

FillPdfTestCase
Tests the PDF handling functions of the API (a.k.a. the whole API).

Code

public function testPdfUpload() {

  // FillPDF not configured.
  $this
    ->drupalGet('admin/structure/fillpdf');
  $this
    ->assertText('Before you can upload PDF files, you must configure FillPDF.');
  $this
    ->assertNoFieldByXPath('//input[@id="edit-upload-pdf"]', NULL, 'PDF upload component does not exist when FillPDF is not configured.');

  // FillPDF configured.
  $this
    ->configureBackend();
  $this
    ->drupalGet('admin/structure/fillpdf');
  $this
    ->assertFieldByXPath('//input[@id="edit-upload-pdf"]', NULL, 'PDF upload component exists.');
  $this
    ->assertFieldByXPath('//input[@id="edit-upload-pdf"][@type="file"][@accept="application/pdf"]', NULL, 'PDF upload component has appropriate attributes.');
}