public function GroupContentStorageTest::testCreateForUnsavedGroup in Group 8
Same name and namespace in other branches
- 2.0.x tests/src/Kernel/GroupContentStorageTest.php \Drupal\Tests\group\Kernel\GroupContentStorageTest::testCreateForUnsavedGroup()
Tests the creation of a GroupContent entity using an unsaved group.
@covers ::createForEntityInGroup
File
- tests/
src/ Kernel/ GroupContentStorageTest.php, line 82
Class
- GroupContentStorageTest
- Tests the behavior of group content storage handler.
Namespace
Drupal\Tests\group\KernelCode
public function testCreateForUnsavedGroup() {
$group = $this
->createUnsavedGroup();
$account = $this
->createUser();
$this
->expectException(EntityStorageException::class);
$this
->expectExceptionMessage('Cannot add an entity to an unsaved group.');
$this->storage
->createForEntityInGroup($account, $group, 'user_as_content');
}