You are here

public function PermissionEventTest::testInvalidGroupContentOperationPermissionCreation in Organic groups 8

Tests creation of an invalid operation permission.

File

tests/src/Unit/PermissionEventTest.php, line 593

Class

PermissionEventTest
Tests permission events.

Namespace

Drupal\Tests\og\Unit

Code

public function testInvalidGroupContentOperationPermissionCreation() {

  // An exception should be thrown when a group content operation permission
  // is created with an invalid owner type.
  $this
    ->expectException(\InvalidArgumentException::class);
  new GroupContentOperationPermission([
    'name' => 'invalid permission',
    'title' => $this
      ->t('This is an invalid permission.'),
    'entity type' => 'node',
    'bundle' => 'article',
    'operation' => 'create',
    'owner' => 'an invalid owner',
  ]);
}