You are here

public function ProtectionRuleUnitTest::testProtectedEntityTypeId in User protect 8

Tests setProtectedEntityTypeId() and getProtectedEntityTypeId().

File

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

Class

ProtectionRuleUnitTest
Various unit tests for protection rules.

Namespace

Drupal\Tests\userprotect\Kernel\Entity

Code

public function testProtectedEntityTypeId() {
  $this
    ->assertIdentical('user_role', $this->protectionRule
    ->getProtectedEntityTypeId());
  $entity_type = 'user';
  $this
    ->assertInstanceOf(ProtectionRuleInterface::class, $this->protectionRule
    ->setProtectedEntityTypeId($entity_type));
  $this
    ->assertIdentical($entity_type, $this->protectionRule
    ->getProtectedEntityTypeId());
}