You are here

public function ProtectionRuleUnitTest::testBypassRoles in User protect 8

Tests setBypassRoles() and getBypassRoles().

File

tests/src/Kernel/Entity/ProtectionRuleUnitTest.php, line 89

Class

ProtectionRuleUnitTest
Various unit tests for protection rules.

Namespace

Drupal\Tests\userprotect\Kernel\Entity

Code

public function testBypassRoles() {
  $this
    ->assertIdentical([], $this->protectionRule
    ->getBypassRoles());
  $roles = [
    'administrator',
  ];
  $this
    ->assertInstanceOf(ProtectionRuleInterface::class, $this->protectionRule
    ->setBypassRoles($roles));
  $this
    ->assertIdentical($roles, $this->protectionRule
    ->getBypassRoles());
}