function MigrateFieldPluginManagerTest::testNonExistentPluginExceptions

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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,
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.