public function MigrateStubTest::testExceptionOnPluginNotFound in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testExceptionOnPluginNotFound()
Tests that an error is logged if the plugin manager throws an exception.
File
- core/
modules/ migrate/ tests/ src/ Unit/ MigrateStubTest.php, line 72
Class
- MigrateStubTest
- Tests the migrate stub service.
Namespace
Drupal\Tests\migrate\UnitCode
public function testExceptionOnPluginNotFound() {
$this->migrationPluginManager
->createInstances([
'test_migration',
])
->willReturn([]);
$this
->expectException(PluginNotFoundException::class);
$this
->expectExceptionMessage("Plugin ID 'test_migration' was not found.");
$stub = new MigrateStub($this->migrationPluginManager
->reveal());
$stub
->createStub('test_migration', [
1,
]);
}