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