You are here

public function GroupContentEnablerManagerTest::testGetHandlerMissingHandler in Group 8

Tests exception thrown when a plugin has not defined the requested handler.

@covers ::getHandler

File

tests/src/Unit/GroupContentEnablerManagerTest.php, line 212

Class

GroupContentEnablerManagerTest
Tests the GroupContentEnabler plugin manager.

Namespace

Drupal\Tests\group\Unit

Code

public function testGetHandlerMissingHandler() {
  $this
    ->setUpPluginDefinitions([
    'apple' => [
      'handlers' => [],
    ],
  ]);
  $this
    ->expectException(InvalidPluginDefinitionException::class);
  $this
    ->expectExceptionMessage('The "apple" plugin did not specify a foo_handler handler.');
  $this->groupContentEnablerManager
    ->getHandler('apple', 'foo_handler');
}