UserPermissionsContextTest.php in GraphQL 8.3
File
tests/src/Kernel/Framework/UserPermissionsContextTest.php
View source
<?php
namespace Drupal\Tests\graphql\Kernel\Framework;
use Drupal\Tests\graphql\Kernel\GraphQLTestBase;
class UserPermissionsContextTest extends GraphQLTestBase {
public function testUserPermissionsContext() {
$this
->mockField('root', [
'name' => 'root',
'type' => 'String',
], 'test');
$result = $this
->query('query { root }');
$this
->assertContains('user.permissions', $result
->getCacheableMetadata()
->getCacheContexts());
}
}