Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / migrate / tests / src / Kernel / SqlBaseTest.php
index 7115860c39dd0134b53937a1e9f0e60e89d68b58..8837d5f38d283effe66be2292626e147a6615c82 100644 (file)
@@ -9,6 +9,7 @@ namespace Drupal\Tests\migrate\Kernel;
 
 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 @@ class SqlBaseTest extends MigrateTestBase {
 
     // 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 @@ class SqlBaseTest extends MigrateTestBase {
       $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);