You are here

public function GroupTypeManagerTest::testGetGroupBundleIdsByEntityType in Organic groups 8

Tests getting all the groups IDs of an entity type.

@covers ::getGroupBundleIdsByEntityType

File

tests/src/Unit/GroupTypeManagerTest.php, line 196

Class

GroupTypeManagerTest
Tests the group manager.

Namespace

Drupal\Tests\og\Unit

Code

public function testGetGroupBundleIdsByEntityType() {

  // It is expected that the group map will be retrieved from config.
  $groups = [
    'test_entity' => [
      'a',
      'b',
    ],
  ];
  $this
    ->expectGroupMapRetrieval($groups);
  $manager = $this
    ->createGroupManager();
  $this
    ->assertSame($groups['test_entity'], $manager
    ->getGroupBundleIdsByEntityType('test_entity'));
  $this
    ->assertSame([], $manager
    ->getGroupBundleIdsByEntityType('test_entity_non_existent'));
}