You are here

public function GroupContentStorageTest::testCreateForInvalidPluginId in Group 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Kernel/GroupContentStorageTest.php \Drupal\Tests\group\Kernel\GroupContentStorageTest::testCreateForInvalidPluginId()

Tests the creation of a GroupContent entity using an incorrect plugin ID.

@covers ::createForEntityInGroup

File

tests/src/Kernel/GroupContentStorageTest.php, line 110

Class

GroupContentStorageTest
Tests the behavior of group content storage handler.

Namespace

Drupal\Tests\group\Kernel

Code

public function testCreateForInvalidPluginId() {
  $group = $this
    ->createGroup();
  $account = $this
    ->createUser();
  $this
    ->expectException(EntityStorageException::class);
  $this
    ->expectExceptionMessage('Invalid plugin provided for adding the entity to the group.');
  $this->storage
    ->createForEntityInGroup($account, $group, 'group_as_content');
}