function MigrateStubTest::testExceptionOnDerivedMigration
Tests that an error is logged on derived migrations.
File
- 
              core/modules/ migrate/ tests/ src/ Unit/ MigrateStubTest.php, line 83 
Class
- MigrateStubTest
- Tests the migrate stub service.
Namespace
Drupal\Tests\migrate\UnitCode
public function testExceptionOnDerivedMigration() {
  $this->migrationPluginManager
    ->createInstances([
    'test_migration',
  ])
    ->willReturn([
    'test_migration:d1' => $this->prophesize(MigrationInterface::class)
      ->reveal(),
    'test_migration:d2' => $this->prophesize(MigrationInterface::class)
      ->reveal(),
  ]);
  $this->expectException(\LogicException::class);
  $this->expectExceptionMessage('Cannot stub derivable migration "test_migration".  You must specify the id of a specific derivative to stub.');
  $stub = new MigrateStub($this->migrationPluginManager
    ->reveal());
  $stub->createStub('test_migration', [
    1,
  ]);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
