public function GroupQueryAccessHandlerTest::testBypassAccess in Group 2.0.x
Same name and namespace in other branches
- 8 tests/src/Kernel/GroupQueryAccessHandlerTest.php \Drupal\Tests\group\Kernel\GroupQueryAccessHandlerTest::testBypassAccess()
Tests that the the query is not altered for people who can bypass access.
@covers ::getConditions
File
- tests/
src/ Kernel/ GroupQueryAccessHandlerTest.php, line 39
Class
- GroupQueryAccessHandlerTest
- Tests the behavior of group query access handler.
Namespace
Drupal\Tests\group\KernelCode
public function testBypassAccess() {
$user = $this
->createUser([], [
'bypass group access',
]);
foreach ([
'view',
'update',
'delete',
] as $operation) {
$conditions = $this->handler
->getConditions($operation, $user);
$this
->assertEquals(0, $conditions
->count());
$this
->assertEqualsCanonicalizing([
'user.permissions',
], $conditions
->getCacheContexts());
$this
->assertFalse($conditions
->isAlwaysFalse());
}
}