From ebe0984f5d4957c22592dd882ad1bfc83c2f3565 Mon Sep 17 00:00:00 2001
From: Aaron Bauman <aaron@messageagency.com>
Date: Thu, 20 Mar 2025 11:46:02 -0400
Subject: [PATCH] Fix tests

---
 .../tests/src/Unit/SalesforceMappingTest.php                 | 5 +++--
 modules/salesforce_pull/src/DeleteHandler.php                | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
index 5a5df8ce..5447866f 100644
--- a/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
+++ b/modules/salesforce_mapping/tests/src/Unit/SalesforceMappingTest.php
@@ -192,11 +192,12 @@ class SalesforceMappingTest extends UnitTestCase {
     $expectedQuery->addCondition($this->mapping->getPullTriggerDate(), gmdate('Y-m-d\TH:i:s\Z', $start), '>');
     $expectedQuery->addCondition($this->mapping->getPullTriggerDate(), gmdate('Y-m-d\TH:i:s\Z', $stop), '<');
     $expectedQuery->fields = $this->mapping->getPullFieldsArray();
-    $expectedQuery->fields[] = 'Id';
-    $expectedQuery->fields[] = $this->mapping->getPullTriggerDate();
     $expectedQuery->order[$this->mapping->getPullTriggerDate()] = 'ASC';
     ksort($expectedQuery->fields);
     ksort($query->fields);
+    $expectedQuery->fields['Id'] = 'Id';
+    $expectedQuery->fields[$this->mapping->getPullTriggerDate()] = $this->mapping->getPullTriggerDate();
+    $expectedQuery->fields['LastModifiedDate'] = 'LastModifiedDate';
     $this->assertEquals($expectedQuery->fields, $query->fields);
     ksort($expectedQuery->order);
     ksort($query->order);
diff --git a/modules/salesforce_pull/src/DeleteHandler.php b/modules/salesforce_pull/src/DeleteHandler.php
index bf7a3058..e11a9db4 100644
--- a/modules/salesforce_pull/src/DeleteHandler.php
+++ b/modules/salesforce_pull/src/DeleteHandler.php
@@ -227,12 +227,12 @@ class DeleteHandler {
       try {
         // Flag this entity to avoid duplicate processing.
         $entity->setSyncing(TRUE);
-
+        $entity_id = $entity->id(),
         $entity->delete();
         $message = 'Deleted entity %label with ID: %id associated with Salesforce Object ID: %sfid';
         $args = [
           '%label' => $entity->label(),
-          '%id' => $mapped_object->entity_id,
+          '%id' => $entity->id(),
           '%sfid' => $record['id'],
         ];
         $this->eventDispatcher->dispatch(new SalesforceNoticeEvent(NULL, $message, $args), SalesforceEvents::NOTICE);
-- 
GitLab