You are here

public function GroupContentCrudHookTest::testUngroupedEntityDeletion in Group 8

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

Tests that an ungrouped entity deletion triggers no group content deletion.

File

tests/src/Kernel/GroupContentCrudHookTest.php, line 37

Class

GroupContentCrudHookTest
Tests the way group content entities react to entity CRUD events.

Namespace

Drupal\Tests\group\Kernel

Code

public function testUngroupedEntityDeletion() {
  $group = $this
    ->createGroup();
  $count = count($group
    ->getContent());
  $this
    ->createUser()
    ->delete();
  $this
    ->assertCount($count, $group
    ->getContent(), "Deleting an ungrouped user account does not remove any group content.");
}