public function GroupContentStorageTest::testCreateForInvalidBundle in Group 8
Same name and namespace in other branches
- 2.0.x tests/src/Kernel/GroupContentStorageTest.php \Drupal\Tests\group\Kernel\GroupContentStorageTest::testCreateForInvalidBundle()
Tests the creation of a GroupContent entity using an incorrect bundle.
@covers ::createForEntityInGroup
File
- tests/
src/ Kernel/ GroupContentStorageTest.php, line 124
Class
- GroupContentStorageTest
- Tests the behavior of group content storage handler.
Namespace
Drupal\Tests\group\KernelCode
public function testCreateForInvalidBundle() {
$group = $this
->createGroup();
$subgroup = $this
->createGroup([
'type' => 'other',
]);
$this
->expectException(EntityStorageException::class);
$this
->expectExceptionMessage("The provided plugin provided does not support the entity's bundle.");
$this->storage
->createForEntityInGroup($subgroup, $group, 'group_as_content');
}