MigrateLookup example

$destination = $this->prophesize(MigrateDestinationInterface::class);
    $destination->getIds()->willReturn(['id' => ['type' => 'integer']]);

    $migration = $this->prophesize(MigrationInterface::class);
    $migration->getIdMap()->willReturn($id_map->reveal());
    $migration->getDestinationPlugin()->willReturn($destination->reveal());

    $plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
    $plugin_manager->createInstances('test_migration')->willReturn([$migration->reveal()]);

    $lookup = new MigrateLookup($plugin_manager->reveal());

    $this->assertSame([['id' => 2]]$lookup->lookup('test_migration', $source_ids));
  }

  /** * Tests message logged when a single migration is not found. * * @dataProvider providerExceptionOnMigrationNotFound */
  public function testExceptionOnMigrationNotFound($migrations$message) {
    $migration_plugin_manager = $this->prophesize(MigrationPluginManagerInterface::class);
    
Home | Imprint | This part of the site doesn't use cookies.