function 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 74
Class
- MigrateStubTest
- Tests the migrate stub service.
Namespace
Drupal\Tests\migrate\UnitCode
public function testExceptionOnPluginNotFound() : void {
$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,
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.