From ad136b8d3f9b16ca96f0fc32e038bde22637e740 Mon Sep 17 00:00:00 2001
From: Liam Morland <liam@openplus.ca>
Date: Wed, 6 Mar 2024 11:21:21 -0500
Subject: [PATCH] Issue #3426100: Ensure string arguments are strings in
 testing

---
 tests/src/Functional/FillPdfFormFormTest.php      | 2 +-
 tests/src/Functional/FillPdfSettingsFormTest.php  | 2 +-
 tests/src/Functional/PdfWebformPopulationTest.php | 2 +-
 tests/src/Traits/TestFillPdfTrait.php             | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/src/Functional/FillPdfFormFormTest.php b/tests/src/Functional/FillPdfFormFormTest.php
index 13531cb..1381977 100644
--- a/tests/src/Functional/FillPdfFormFormTest.php
+++ b/tests/src/Functional/FillPdfFormFormTest.php
@@ -55,7 +55,7 @@ class FillPdfFormFormTest extends FillPdfUploadTestBase {
       $this->assertSession()->fieldValueEquals('default_entity_type', $type);
 
       // Check the default entity ID field is present but empty.
-      $this->assertSession()->fieldValueEquals('default_entity_id', NULL);
+      $this->assertSession()->fieldValueEquals('default_entity_id', '');
 
       if ($count == 0) {
         $options = $this->assertSession()->selectExists('default_entity_id')->findAll('xpath', 'option');
diff --git a/tests/src/Functional/FillPdfSettingsFormTest.php b/tests/src/Functional/FillPdfSettingsFormTest.php
index 5616570..a29705f 100644
--- a/tests/src/Functional/FillPdfSettingsFormTest.php
+++ b/tests/src/Functional/FillPdfSettingsFormTest.php
@@ -254,7 +254,7 @@ class FillPdfSettingsFormTest extends BrowserTestBase {
     $this->assertSession()->pageTextContains('The configuration options have been saved.');
     // So the new values should be submitted *and* saved this time, except for
     // the unrelated 'fillpdf_service_api_key' which should be dismissed.
-    $expected = ['fillpdf_service_api_key' => NULL] + $edit;
+    $expected = ['fillpdf_service_api_key' => ''] + $edit;
     foreach ($expected as $field => $value) {
       $this->assertSession()->fieldValueEquals($field, $value);
       $config_name = $field === 'example_setting' ? 'fillpdf_test.settings' : 'fillpdf.settings';
diff --git a/tests/src/Functional/PdfWebformPopulationTest.php b/tests/src/Functional/PdfWebformPopulationTest.php
index 4cc1547..79515fb 100644
--- a/tests/src/Functional/PdfWebformPopulationTest.php
+++ b/tests/src/Functional/PdfWebformPopulationTest.php
@@ -59,7 +59,7 @@ class PdfWebformPopulationTest extends FillPdfTestBase {
     $contact_form = Webform::load('fillpdf_contact');
     $contact_form_test_route = Url::fromRoute('entity.webform.test_form', ['webform' => $contact_form->id()]);
     $this->drupalGet($contact_form_test_route);
-    $this->submitForm([], $this->t('Send message'));
+    $this->submitForm([], (string) $this->t('Send message'));
 
     // Load the submission.
     $this->testSubmission = WebformSubmission::load($this->getLastSubmissionId($contact_form));
diff --git a/tests/src/Traits/TestFillPdfTrait.php b/tests/src/Traits/TestFillPdfTrait.php
index 01adede..7401d01 100644
--- a/tests/src/Traits/TestFillPdfTrait.php
+++ b/tests/src/Traits/TestFillPdfTrait.php
@@ -64,7 +64,7 @@ trait TestFillPdfTrait {
       'local_service_endpoint' => $localServerEndpoint ?: 'http://127.0.0.1:8085',
     ];
     $this->drupalGet('admin/config/media/fillpdf');
-    $this->submitForm($edit, t('Save configuration'));
+    $this->submitForm($edit, (string) t('Save configuration'));
   }
 
   /**
-- 
GitLab