You are here

public function PermissionModeTest::testHandleNode in Permissions by Term 8.2

File

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

Class

PermissionModeTest
Class AccessCheckTest

Namespace

Drupal\Tests\permissions_by_term\Kernel

Code

public function testHandleNode() : void {
  $this
    ->createRelationWithoutRestriction();
  self::assertInternalType('string', $this
    ->getNidNoRestriction());
  $node = Node::load($this
    ->getNidNoRestriction());
  self::assertInstanceOf(AccessResultNeutral::class, $this->accessCheck
    ->handleNode($node, $node
    ->language()
    ->getId()));
  \Drupal::configFactory()
    ->getEditable('permissions_by_term.settings')
    ->set('permission_mode', TRUE)
    ->save();
  self::assertInstanceOf(AccessResultForbidden::class, $this->accessCheck
    ->handleNode($node, $node
    ->language()
    ->getId()));
}