function MigrateSqlIdMapTest::getIdMap

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMap()
  2. 8.9.x core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest::getIdMap()
  3. 10 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.

21 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::testGetHighestId in core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
Tests getHighestId method.

... See full list

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.