Same name and namespace in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMap()
  2. 9 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMap()

Creates a test SQL ID map plugin.

Return value

\Drupal\Tests\migrate\Unit\TestSqlIdMap A SQL ID map plugin test instance.

24 calls to MigrateSqlIdMapTest::getIdMap()
MigrateSqlIdMapTest::doTestLookupSourceIdMapping in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Performs the source ID test on source and destination fields.
MigrateSqlIdMapTest::setupRows in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Setup a database with the given rows.
MigrateSqlIdMapTest::testClearMessages in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Tests the clear messages method.
MigrateSqlIdMapTest::testDestroy in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Tests the destroy method.
MigrateSqlIdMapTest::testErrorCount in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Performs error count test with a given number of error rows.

... See full list

File

core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php, line 101

Class

MigrateSqlIdMapTest
Tests the SQL ID map plugin.

Namespace

Drupal\Tests\migrate\Unit

Code

protected function getIdMap() {
  $migration = $this
    ->getMigration();
  $plugin = $this
    ->createMock('Drupal\\migrate\\Plugin\\MigrateSourceInterface');
  $plugin
    ->method('getIds')
    ->willReturn($this->sourceIds);
  $migration
    ->method('getSourcePlugin')
    ->willReturn($plugin);
  $plugin = $this
    ->createMock('Drupal\\migrate\\Plugin\\MigrateDestinationInterface');
  $plugin
    ->method('getIds')
    ->willReturn($this->destinationIds);
  $migration
    ->method('getDestinationPlugin')
    ->willReturn($plugin);
  $event_dispatcher = $this
    ->createMock('Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface');
  $migration_manager = $this
    ->createMock('Drupal\\migrate\\Plugin\\MigrationPluginManagerInterface');
  $id_map = new TestSqlIdMap($this->database, [], 'sql', [], $migration, $event_dispatcher, $migration_manager);
  $migration
    ->method('getIdMap')
    ->willReturn($id_map);
  return $id_map;
}