public function AccessCheckTest::testNoTermRestriction in Permissions by Term 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/AccessCheckTest.php \Drupal\Tests\permissions_by_term\Kernel\AccessCheckTest::testNoTermRestriction()
File
- tests/
src/ Kernel/ AccessCheckTest.php, line 66
Class
- AccessCheckTest
- Class AccessCheckTest
Namespace
Drupal\Tests\permissions_by_term\KernelCode
public function testNoTermRestriction() : void {
$database = $this->container
->get('database');
$database
->truncate('node_access')
->execute();
$this
->createRelationWithoutRestriction();
\Drupal::configFactory()
->getEditable('permissions_by_term.settings')
->set('require_all_terms_granted', FALSE)
->save();
$this
->assertTrue($this->accessCheck
->canUserAccessByNode(Node::load($this
->getNidNoRestriction())));
node_access_rebuild();
$gids = $this->accessStorage
->getGids(\Drupal::service('current_user'));
self::assertNull($gids);
}