You are here

public function GroupTypeManagerTest::testIsGroup in Organic groups 8

Tests checking if an entity is a group.

@covers ::isGroup

@dataProvider providerTestIsGroup

File

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

Class

GroupTypeManagerTest
Tests the group manager.

Namespace

Drupal\Tests\og\Unit

Code

public function testIsGroup($entity_type_id, $bundle_id, $expected_result) {

  // 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($expected_result, $manager
    ->isGroup($entity_type_id, $bundle_id));
}