From 90c8bf792a1b0d6e11635abdc80977ce6444a240 Mon Sep 17 00:00:00 2001 From: Aaron Bauman <aaron@messageagency.com> Date: Fri, 12 Mar 2021 13:59:18 -0500 Subject: [PATCH] Couple more deprecations --- .../src/Tests/SalesforceMappingCrudFormTest.php | 10 ++++++---- tests/src/Functional/StatusPageTest.php | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php index b5142749..b5c1a566 100644 --- a/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php +++ b/modules/salesforce_mapping_ui/src/Tests/SalesforceMappingCrudFormTest.php @@ -63,6 +63,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase { $mappingStorage = \Drupal::entityTypeManager()->getStorage('salesforce_mapping'); $this->drupalLogin($this->adminSalesforceUser); + $this->drupalGet('admin/structure/salesforce/mappings/add'); /* Salesforce Mapping Add Form */ $mapping_name = 'mapping' . rand(100, 10000); $post = [ @@ -72,7 +73,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase { 'drupal_bundle' => 'salesforce_mapping_test_content', 'salesforce_object_type' => 'Contact', ]; - $this->drupalPostForm('admin/structure/salesforce/mappings/add', $post, $this->t('Save')); + $this->submitForm($post, $this->t('Save')); $this->assertSession()->pageTextContainsOnce($this->t('The mapping has been successfully saved.')); $mapping = $mappingStorage->load($mapping_name); @@ -83,13 +84,14 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase { /* Salesforce Mapping Edit Form */ // Need to rebuild caches before proceeding to edit link. drupal_flush_all_caches(); + $this->drupalGet('admin/structure/salesforce/mappings/manage/' . $mapping_name); $post = [ 'label' => $this->randomMachineName(), 'drupal_entity_type' => 'node', 'drupal_bundle' => 'salesforce_mapping_test_content', 'salesforce_object_type' => 'Contact', ]; - $this->drupalPostForm('admin/structure/salesforce/mappings/manage/' . $mapping_name, $post, $this->t('Save')); + $this->submitForm($post, $this->t('Save')); $this->assertSession()->fieldValueEquals('label', $post['label']); // Test simply adding a field plugin of every possible type. This is not @@ -105,7 +107,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase { if (call_user_func([$definition['class'], 'isAllowed'], $mapping)) { // Add a new field: $post['buttons[field_type]'] = $definition['id']; - $this->drupalPostForm(NULL, $post, $this->t('Add a field mapping to get started')); + $this->submitForm($post, $this->t('Add a field mapping to get started')); // Confirm that the new field shows up: $this->assertSession()->pageTextContains($definition['label']); @@ -127,7 +129,7 @@ class SalesforceMappingCrudFormTest extends BrowserTestBase { } // Confirm that form saves correctly. - $this->drupalPostForm(NULL, $post, $this->t('Save')); + $this->submitForm($post, $this->t('Save')); $this->assertSession()->pageTextContainsOnce($this->t('The mapping has been successfully saved.')); // Confirm that the changes are stored properly by reloading and counting the fields. diff --git a/tests/src/Functional/StatusPageTest.php b/tests/src/Functional/StatusPageTest.php index 135e7e5e..4083fb3f 100644 --- a/tests/src/Functional/StatusPageTest.php +++ b/tests/src/Functional/StatusPageTest.php @@ -27,7 +27,7 @@ class StatusPageTest extends BrowserTestBase { * * @var array */ - public static $modules = ['salesforce', 'salesforce_test_rest_client']; + protected static $modules = ['salesforce', 'salesforce_test_rest_client']; /** * Auth provider manager service. @@ -60,7 +60,7 @@ class StatusPageTest extends BrowserTestBase { /** * {@inheritDoc} */ - public function setUp() { + public function setUp(): void { parent::setUp(); $this->authMan = \Drupal::service('plugin.manager.salesforce.auth_providers'); $file = __DIR__ . "/../../../salesforce.install"; -- GitLab