You are here

public function ProtectionRuleUnitTest::testProtectedEntityId in User protect 8

Tests setProtectedEntityId() and getProtectedEntityId().

File

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

Class

ProtectionRuleUnitTest
Various unit tests for protection rules.

Namespace

Drupal\Tests\userprotect\Kernel\Entity

Code

public function testProtectedEntityId() {
  $this
    ->assertIdentical('administrator', $this->protectionRule
    ->getProtectedEntityId());
  $entity_id = 'authenticated';
  $this
    ->assertInstanceOf(ProtectionRuleInterface::class, $this->protectionRule
    ->setProtectedEntityId($entity_id));
  $this
    ->assertIdentical($entity_id, $this->protectionRule
    ->getProtectedEntityId());
}