You are here

public function PermissionProviderTest::testGetRelationCreatePermission in Group 2.0.x

Tests the relation create permission name.

@covers ::getPermission @dataProvider relationCreatePermissionProvider

Parameters

mixed $expected: The expected return value.

string $plugin_id: The plugin ID.

array $definition: The plugin definition.

bool $implements_owner: Whether the plugin's entity type deals with ownership.

bool $implements_published: Whether the plugin's entity type deals with publishing of entities.

File

tests/src/Unit/PermissionProviderTest.php, line 209

Class

PermissionProviderTest
Tests the default group relation permission_provider handler.

Namespace

Drupal\Tests\group\Unit

Code

public function testGetRelationCreatePermission($expected, $plugin_id, array $definition, $implements_owner, $implements_published) {
  $permission_provider = $this
    ->createPermissionProvider($plugin_id, $definition, $implements_owner, $implements_published);
  $this
    ->assertEquals($expected, $permission_provider
    ->getPermission('create', 'relation'));
}