You are here

public function MigrateStubTest::testExceptionOnPluginNotFound in Drupal 8

Same name and namespace in other branches
  1. 9 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\Unit

Code

public function testExceptionOnPluginNotFound() {
  $this->migrationPluginManager
    ->createInstances([
    'test_migration',
  ])
    ->willReturn([]);
  $this
    ->expectException(PluginNotFoundException::class);
  $stub = new MigrateStub($this->migrationPluginManager
    ->reveal());
  $stub
    ->createStub('test_migration', [
    1,
  ]);
}