You are here

public function PermissionEventTest::testOffsetSetInvalidPermission in Organic groups 8

Tests setting invalid permissions through ArrayAccess.

@dataProvider offsetSetInvalidPermissionProvider

Parameters

string $key: The key to use when setting the permission through ArrayAccess.

mixed $permission: A test value to set through ArrayAccess.

File

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

Class

PermissionEventTest
Tests permission events.

Namespace

Drupal\Tests\og\Unit

Code

public function testOffsetSetInvalidPermission($key, $permission) {
  $this
    ->expectException(\InvalidArgumentException::class);

  // phpcs:disable DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable
  $event = new PermissionEvent($this
    ->randomMachineName(), $this
    ->randomMachineName(), []);
  $event[$key] = $permission;

  // phpcs:enable DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable
}