public function MigrateStubTest::testExceptionOnDerivedMigration in Drupal 10
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testExceptionOnDerivedMigration()
- 9 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\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,
]);
}