protected function PdfWebformPopulationTest::setUp in FillPDF 8.4
Same name and namespace in other branches
- 5.0.x tests/src/Functional/PdfWebformPopulationTest.php \Drupal\Tests\fillpdf\Functional\PdfWebformPopulationTest::setUp()
Overrides FillPdfTestBase::setUp
File
- tests/
src/ Functional/ PdfWebformPopulationTest.php, line 45
Class
- PdfWebformPopulationTest
- Tests Webform population and image stamping.
Namespace
Drupal\Tests\fillpdf\FunctionalCode
protected function setUp() {
parent::setUp();
// Add some roles to this user.
$existing_user_roles = $this->adminUser
->getRoles(TRUE);
$role_to_modify = Role::load(end($existing_user_roles));
// Grant additional permissions to this user.
$this
->grantPermissions($role_to_modify, [
'administer webform',
'access webform submission log',
'create webform',
]);
// Create a test submission for our Contact form.
$contact_form = Webform::load('fillpdf_contact');
$contact_form_test_route = Url::fromRoute('entity.webform.test_form', [
'webform' => $contact_form
->id(),
]);
$this
->drupalPostForm($contact_form_test_route, [], t('Send message'));
// Load the submission.
$this->testSubmission = WebformSubmission::load($this
->getLastSubmissionId($contact_form));
}