You are here

protected function TestFillPdfTrait::getLatestFillPdfForm 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::getLatestFillPdfForm()

Gets the ID of the latest fillpdf_form stored.

Return value

int ID of the lates FillPdf Form stored.

23 calls to TestFillPdfTrait::getLatestFillPdfForm()
FillPdfFormDeleteFormTest::testDeleteForm in tests/src/Functional/FillPdfFormDeleteFormTest.php
Tests the cancel link works.
FillPdfFormDeleteFormTest::testDeleteFormCancel in tests/src/Functional/FillPdfFormDeleteFormTest.php
Tests the cancel link works.
FillPdfFormDuplicateFormTest::testDuplicateForm in tests/src/Functional/FillPdfFormDuplicateFormTest.php
Tests the duplicate function.
FillPdfFormFormTest::testFillPdfFileUsage in tests/src/Functional/FillPdfFormFormTest.php
Tests proper registration of managed_files.
FillPdfFormFormTest::testFormFormUpload in tests/src/Functional/FillPdfFormFormTest.php
Tests the FillPdfForm entity's edit form.

... See full list

File

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

Class

TestFillPdfTrait
Provides methods for testing FillPdf.

Namespace

Drupal\Tests\fillpdf\Traits

Code

protected function getLatestFillPdfForm() {
  $entity_query = $this->container
    ->get('entity_type.manager')
    ->getStorage('fillpdf_form')
    ->getQuery();
  $max_fid_after_result = $entity_query
    ->sort('fid', 'DESC')
    ->range(0, 1)
    ->execute();
  return reset($max_fid_after_result);
}