public function EntityEmbedFilterTest::providerAccessUnpublished in Entity Embed 8
Data provider for testAccessUnpublished().
File
- tests/
src/ Kernel/ EntityEmbedFilterTest.php, line 207
Class
- EntityEmbedFilterTest
- @coversDefaultClass \Drupal\entity_embed\Plugin\Filter\EntityEmbedFilter @group entity_embed
Namespace
Drupal\Tests\entity_embed\KernelCode
public function providerAccessUnpublished() {
return [
'user cannot access embedded entity' => [
FALSE,
FALSE,
(new CacheableMetadata())
->setCacheTags([
'foo:1',
'node:1',
])
->setCacheContexts([
'user.permissions',
])
->setCacheMaxAge(Cache::PERMANENT),
[],
],
'user can access embedded entity' => [
TRUE,
TRUE,
(new CacheableMetadata())
->setCacheTags([
'config:filter.format.plain_text',
'foo:1',
'node:1',
'node_view',
'user:2',
'user_view',
])
->setCacheContexts([
'timezone',
'user',
'user.permissions',
])
->setCacheMaxAge(Cache::PERMANENT),
[
'library' => [
'entity_embed/caption',
],
],
],
];
}