public function SubgroupTest::testDeleteSubgroupFromGroupContent in Subgroup (Graph) 1.0.x
Tests the removing subgroup from group.
File
- tests/
src/ Kernel/ SubgroupTest.php, line 61
Class
- SubgroupTest
- Tests the behavior of subgroup creators.
Namespace
Drupal\Tests\ggroup\KernelCode
public function testDeleteSubgroupFromGroupContent() {
/* @var Group $subGroup */
list($group, $sub_group) = $this
->addGroup();
foreach (GroupContent::loadByEntity($sub_group) as $group_content) {
$group_content
->delete();
$this
->assertEquals(\Drupal::service('ggroup.group_hierarchy_manager')
->groupHasSubgroup($group, $sub_group), FALSE, 'Subgroup is removed');
}
}