public function MigrateLookupTest::testExceptionOnMigrationNotFound in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/MigrateLookupTest.php \Drupal\Tests\migrate\Unit\MigrateLookupTest::testExceptionOnMigrationNotFound()
- 10 core/modules/migrate/tests/src/Unit/MigrateLookupTest.php \Drupal\Tests\migrate\Unit\MigrateLookupTest::testExceptionOnMigrationNotFound()
Tests message logged when a single migration is not found.
@dataProvider providerExceptionOnMigrationNotFound
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateLookupTest.php, line 55
Class
- MigrateLookupTest
- Provides unit testing for the migration lookup service.
Namespace
Drupal\Tests\migrate\UnitCode
public function testExceptionOnMigrationNotFound($migrations, $message) {
$migration_plugin_manager = $this
->prophesize(MigrationPluginManagerInterface::class);
$migration_plugin_manager
->createInstances($migrations)
->willReturn([]);
$this
->expectException(PluginNotFoundException::class);
$this
->expectExceptionMessage($message);
$lookup = new MigrateLookup($migration_plugin_manager
->reveal());
$lookup
->lookup($migrations, [
1,
]);
}