You are here

public function GroupMembershipManagerTest::testGetGroupCount in Organic groups 8

Tests if the number of groups associated with group content is correct.

@covers ::getGroupCount @dataProvider groupContentProvider

Parameters

string $group_type_id: Optional group type ID to be passed as an argument to the method under test.

string $group_bundle: Optional group bundle to be passed as an argument to the method under test.

array $expected: An array containing the expected results to be returned.

File

tests/src/Kernel/Entity/GroupMembershipManagerTest.php, line 340

Class

GroupMembershipManagerTest
Tests retrieving groups associated with a given group content.

Namespace

Drupal\Tests\og\Kernel\Entity

Code

public function testGetGroupCount($group_type_id, $group_bundle, array $expected) {
  $result = $this->membershipManager
    ->getGroupCount($this->groupContent, $group_type_id, $group_bundle);

  // Check that the correct results is returned.
  $this
    ->assertEquals(count($expected, COUNT_RECURSIVE) - count($expected), $result);
}