public function EntityQueryAlterTest::testNonMemberGroupAccessWithoutPermission in Group 2.0.x
Same name and namespace in other branches
- 8 tests/src/Kernel/EntityQueryAlterTest.php \Drupal\Tests\group\Kernel\EntityQueryAlterTest::testNonMemberGroupAccessWithoutPermission()
Tests that grouped test entities are properly hidden for non-members.
File
- tests/
src/ Kernel/ EntityQueryAlterTest.php, line 93
Class
- EntityQueryAlterTest
- Tests that Group properly checks access for grouped entities.
Namespace
Drupal\Tests\group\KernelCode
public function testNonMemberGroupAccessWithoutPermission() {
$entity_1 = $this
->createTestEntity();
$entity_2 = $this
->createTestEntity();
$group = $this
->createGroup([
'type' => $this->groupTypeA
->id(),
]);
$group
->addContent($entity_1, 'entity_test_as_content');
$this
->assertQueryAccessResult([
$entity_2
->id(),
], 'Only the ungrouped test entity shows up.');
}