public function LinkCollectionNormalizerTest::linkAccessTestData in Drupal 10
Same name and namespace in other branches
- 9 core/modules/jsonapi/tests/src/Kernel/Normalizer/LinkCollectionNormalizerTest.php \Drupal\Tests\jsonapi\Kernel\Normalizer\LinkCollectionNormalizerTest::linkAccessTestData()
Provides test cases for testing link access checking.
Return value
array[]
File
- core/
modules/ jsonapi/ tests/ src/ Kernel/ Normalizer/ LinkCollectionNormalizerTest.php, line 171
Class
- LinkCollectionNormalizerTest
- @coversDefaultClass \Drupal\jsonapi\Normalizer\LinkCollectionNormalizer @group jsonapi
Namespace
Drupal\Tests\jsonapi\Kernel\NormalizerCode
public function linkAccessTestData() {
return [
'the edit-form link is present because uid 2 has access to the targeted resource (its own edit form)' => [
'uid' => 2,
'edit-form uid' => 2,
'expected link keys' => [
'edit-form',
],
'expected cache contexts' => [
'url.site',
'user',
],
],
"the edit-form link is omitted because uid 3 doesn't have access to the targeted resource (another account's edit form)" => [
'uid' => 3,
'edit-form uid' => 2,
'expected link keys' => [],
'expected cache contexts' => [
'url.site',
'user',
],
],
];
}