public function AccessByOgMembershipTest::testEntityOperationAccess in Organic groups 8
Tests access to entity operations through the access hook.
@dataProvider entityOperationAccessProvider
Parameters
string $user: The name of the user to test.
array $expected_results: An associative array indicating whether the user should have the right to edit content owned by the user represented by the array key.
File
- tests/
src/ Kernel/ Access/ AccessByOgMembershipTest.php, line 178
Class
- AccessByOgMembershipTest
- Tests access to content by OgMembership.
Namespace
Drupal\Tests\og\Kernel\AccessCode
public function testEntityOperationAccess($user, array $expected_results) {
foreach ($expected_results as $group_content => $expected_result) {
/** @var \Drupal\Core\Access\AccessResult $result */
$result = og_entity_access($this->groupContent[$group_content], 'update', $this->users[$user]);
$this
->assertEquals($expected_result, $result
->isAllowed());
}
}