You are here

public static function GroupManagerSubscriptionTest::groupManagerSubscriptionProvider in Organic groups 8

Data provider for ::testGroupManagerSubscription().

Return value

array An array of test data arrays, each test data array having the following three values:

  • A boolean indicating whether or not the group manager will be marked as the author of the group when the entity is created.
  • A boolean indicating whether or not another hook_entity_insert() will fire first and will override the membership.

File

tests/src/Kernel/GroupManagerSubscriptionTest.php, line 152

Class

GroupManagerSubscriptionTest
Tests if the group manager is subscribed automatically upon group creation.

Namespace

Drupal\Tests\og\Kernel

Code

public static function groupManagerSubscriptionProvider() {
  return [
    // Test a group created by the group manager.
    [
      // Whether or not to set the group manager as author of the group
      // entity.
      TRUE,
      // Whether or not another hook_entity_insert() implementation will fire
      // first and create a subscription.
      FALSE,
    ],
    // Test a group created by an anonymous user.
    [
      FALSE,
      FALSE,
    ],
    // Test a group created by the group manager, but the subscription will be
    // already be created by another hook_entity_insert() implementation. This
    // allows us to test whether developers can override the automatic
    // creation of the membership.
    [
      TRUE,
      TRUE,
    ],
  ];
}