public function EntityPublicationTest::testAnonymousCanViewPublishedNodesWithoutTermPermissions in Permissions by Term 8.2
Published nodes without restrictions should be visible to anonymous users.
File
- modules/
permissions_by_entity/ tests/ src/ Kernel/ EntityPublicationTest.php, line 74
Class
- EntityPublicationTest
- Class EntityPublicationTest.
Namespace
Drupal\Tests\permissions_by_entity\KernelCode
public function testAnonymousCanViewPublishedNodesWithoutTermPermissions() : void {
$this
->assertTrue($this->nodes['node_published']
->isPublished());
$this
->assertEquals(AccessResult::neutral(), permissions_by_entity_entity_access($this->nodes['node_published'], 'view', $this->anonymousUser));
$this
->assertNotEqual(AccessResult::forbidden(), $this->nodes['node_published']
->access('view', $this->anonymousUser, TRUE));
}