diff core/modules/migrate/tests/src/Kernel/SqlBaseTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php	Mon Apr 23 09:46:53 2018 +0100
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Database\Query\ConditionInterface;
 use Drupal\Core\Database\Query\SelectInterface;
+use Drupal\Core\Database\StatementInterface;
 use Drupal\migrate\Exception\RequirementsException;
 use Drupal\Core\Database\Database;
 use Drupal\migrate\Plugin\migrate\source\SqlBase;
@@ -46,8 +47,8 @@
 
     // Verify that falling back to the default 'migrate' connection (defined in
     // the base class) works.
-    $this->assertSame($sql_base->getDatabase()->getTarget(), 'default');
-    $this->assertSame($sql_base->getDatabase()->getKey(), 'migrate');
+    $this->assertSame('default', $sql_base->getDatabase()->getTarget());
+    $this->assertSame('migrate', $sql_base->getDatabase()->getKey());
 
     // Verify the fallback state key overrides the 'migrate' connection.
     $target = 'test_fallback_target';
@@ -149,10 +150,10 @@
       $source->getHighWaterStorage()->set($this->migration->id(), $high_water);
     }
 
-    $query_result = new \ArrayIterator($query_result);
-
-    $query = $this->getMock(SelectInterface::class);
-    $query->method('execute')->willReturn($query_result);
+    $statement = $this->createMock(StatementInterface::class);
+    $statement->expects($this->atLeastOnce())->method('setFetchMode')->with(\PDO::FETCH_ASSOC);
+    $query = $this->createMock(SelectInterface::class);
+    $query->method('execute')->willReturn($statement);
     $query->expects($this->atLeastOnce())->method('orderBy')->with('order', 'ASC');
 
     $condition_group = $this->getMock(ConditionInterface::class);