From 5c360dc9c8871c06134d01bcdd60ca7769628e15 Mon Sep 17 00:00:00 2001
From: Jesse Hofmann-Smith <jesse@opensourcery.com>
Date: Thu, 21 Nov 2013 16:44:19 -0800
Subject: [PATCH] 2137479-2-phpunit-for-getRowByDestination

---
 .../Drupal/migrate/Tests/MigrateSqlIdMapTest.php   | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/core/modules/migrate/tests/Drupal/migrate/Tests/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/Drupal/migrate/Tests/MigrateSqlIdMapTest.php
index ec62d4a..72f3402 100644
--- a/core/modules/migrate/tests/Drupal/migrate/Tests/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/Drupal/migrate/Tests/MigrateSqlIdMapTest.php
@@ -141,6 +141,28 @@ public function testGetSourceByIdSucceeds() {
   }
 
   /**
+   * Test the getRowByDestination method.
+   */
+  public function testGetRowByDestination() {
+    $row = array(
+      'sourceid1' => 'source_id_value_1',
+      'sourceid2' => 'source_id_value_2',
+      'destid1' => 'destination_id_value_1',
+    ) + $this->idMapDefaults();
+    $database_contents['migrate_map_sql_idmap_test'][] = $row;
+    $row = array(
+      'sourceid1' => 'source_id_value_3',
+      'sourceid2' => 'source_id_value_4',
+      'destid1' => 'destination_id_value_2',
+    ) + $this->idMapDefaults();
+    $database_contents['migrate_map_sql_idmap_test'][] = $row;
+    $dest_id_values = array($row['destid1']);
+    $id_map = $this->getIdMap($database_contents);
+    $result_row = $id_map->getRowByDestination($dest_id_values);
+    $this->assertSame($row, $result_row);
+  }
+
+  /**
    * Test the destination ID lookup method.
    *
    * Scenarios to test (for both hits and misses) are:
-- 
1.8.3.4 (Apple Git-47)

