You are here

public function MigrateFieldPluginManagerTest::testNonExistentPluginExceptions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php \Drupal\Tests\migrate_drupal\Kernel\MigrateFieldPluginManagerTest::testNonExistentPluginExceptions()
  2. 10 core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php \Drupal\Tests\migrate_drupal\Kernel\MigrateFieldPluginManagerTest::testNonExistentPluginExceptions()

Tests that a PluginNotFoundException is thrown when a plugin isn't found.

@covers ::getPluginIdFromFieldType @dataProvider nonExistentPluginExceptionsData

File

core/modules/migrate_drupal/tests/src/Kernel/MigrateFieldPluginManagerTest.php, line 74

Class

MigrateFieldPluginManagerTest
Tests the field plugin manager.

Namespace

Drupal\Tests\migrate_drupal\Kernel

Code

public function testNonExistentPluginExceptions($core, $field_type) {
  $this
    ->expectException(PluginNotFoundException::class);
  $this
    ->expectExceptionMessage(sprintf("Plugin ID '%s' was not found.", $field_type));
  $this->pluginManager
    ->getPluginIdFromFieldType($field_type, [
    'core' => $core,
  ]);
}