X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmigrate%2Ftests%2Fsrc%2FKernel%2FSqlBaseTest.php;fp=web%2Fcore%2Fmodules%2Fmigrate%2Ftests%2Fsrc%2FKernel%2FSqlBaseTest.php;h=8837d5f38d283effe66be2292626e147a6615c82;hp=7115860c39dd0134b53937a1e9f0e60e89d68b58;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php b/web/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php index 7115860c3..8837d5f38 100644 --- a/web/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php +++ b/web/core/modules/migrate/tests/src/Kernel/SqlBaseTest.php @@ -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);