protected function MigrateSqlIdMapTest::getIdMap in Zircon Profile 8
Same name and namespace in other branches
- 8.0 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.
17 calls to MigrateSqlIdMapTest::getIdMap()
- 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::testGetRowByDestination in core/
modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php  - Tests the getRowByDestination method.
 - MigrateSqlIdMapTest::testGetRowBySource in core/
modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php  - Tests the getRowBySource method.
 - MigrateSqlIdMapTest::testGetRowsNeedingUpdate in core/
modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php  - Tests the getRowsNeedingUpdate method for rows that need an update.
 
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateSqlIdMapTest.php, line 87  - Contains \Drupal\Tests\migrate\Unit\MigrateSqlIdMapTest.
 
Class
- MigrateSqlIdMapTest
 - Tests the SQL ID map plugin.
 
Namespace
Drupal\Tests\migrate\UnitCode
protected function getIdMap() {
  $migration = $this
    ->getMigration();
  $plugin = $this
    ->getMock('Drupal\\migrate\\Plugin\\MigrateSourceInterface');
  $plugin
    ->method('getIds')
    ->willReturn($this->sourceIds);
  $migration
    ->method('getSourcePlugin')
    ->willReturn($plugin);
  $plugin = $this
    ->getMock('Drupal\\migrate\\Plugin\\MigrateDestinationInterface');
  $plugin
    ->method('getIds')
    ->willReturn($this->destinationIds);
  $migration
    ->method('getDestinationPlugin')
    ->willReturn($plugin);
  $event_dispatcher = $this
    ->getMock('Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
  $id_map = new TestSqlIdMap($this->database, [], 'sql', [], $migration, $event_dispatcher);
  $migration
    ->method('getIdMap')
    ->willReturn($id_map);
  return $id_map;
}