public function GroupContentEnablerManagerTest::testCreateHandlerInstanceNoInterface in Group 8
Tests exception thrown when a handler does not implement the interface.
@covers ::createHandlerInstance
File
- tests/
src/ Unit/ GroupContentEnablerManagerTest.php, line 168
Class
- GroupContentEnablerManagerTest
- Tests the GroupContentEnabler plugin manager.
Namespace
Drupal\Tests\group\UnitCode
public function testCreateHandlerInstanceNoInterface() {
$this
->expectException(InvalidPluginDefinitionException::class);
$this
->expectExceptionMessage('Trying to instantiate a handler that does not implement \\Drupal\\group\\Plugin\\GroupContentHandlerInterface.');
$this->groupContentEnablerManager
->createHandlerInstance(TestGroupContentHandlerWithoutInterface::class, 'some_plugin', []);
}