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;
// 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';
$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);