You are here

public function PermissionModeTest::testNodeAccessRecordCreation in Permissions by Term 8.2

File

tests/src/Kernel/PermissionModeTest.php, line 72

Class

PermissionModeTest
Class AccessCheckTest

Namespace

Drupal\Tests\permissions_by_term\Kernel

Code

public function testNodeAccessRecordCreation() : void {
  $this
    ->createRelationWithoutRestriction();
  self::assertInternalType('string', $this
    ->getNidNoRestriction());
  $node = Node::load($this
    ->getNidNoRestriction());
  $nodeAccessRecord = permissions_by_term_node_access_records($node);
  self::assertNull($nodeAccessRecord);
  $node = Node::load($this
    ->getNidNoRestriction());
  \Drupal::configFactory()
    ->getEditable('permissions_by_term.settings')
    ->set('permission_mode', TRUE)
    ->save();
  $nodeAccessRecord = permissions_by_term_node_access_records($node);
  self::assertIsArray($nodeAccessRecord);
}