You are here

private function SubgroupTest::addGroup in Subgroup (Graph) 1.0.x

Create group and attach subgroup to group.

Return value

array Return group and subgroup.

3 calls to SubgroupTest::addGroup()
SubgroupTest::testCreateSubgroup in tests/src/Kernel/SubgroupTest.php
Tests the addition of a group to a group.
SubgroupTest::testDeleteSubgroup in tests/src/Kernel/SubgroupTest.php
Tests the removing subgroup.
SubgroupTest::testDeleteSubgroupFromGroupContent in tests/src/Kernel/SubgroupTest.php
Tests the removing subgroup from group.

File

tests/src/Kernel/SubgroupTest.php, line 91

Class

SubgroupTest
Tests the behavior of subgroup creators.

Namespace

Drupal\Tests\ggroup\Kernel

Code

private function addGroup() {

  /* @var Group $group */
  $group = $this
    ->createGroupByType($this->groupType
    ->id(), [
    'uid' => $this
      ->getCurrentUser()
      ->id(),
  ]);

  /* @var Group $subGroup */
  $sub_group = $this
    ->createGroupByType($this->subGroupType
    ->id(), [
    'uid' => $this
      ->getCurrentUser()
      ->id(),
  ]);
  $group
    ->addContent($sub_group, 'subgroup:' . $this->subGroupType
    ->id());
  return [
    $group,
    $sub_group,
  ];
}