class GraphQLViewerEndpointTest in Open Social 10.2.x
Same name and namespace in other branches
- 10.3.x modules/social_features/social_user/tests/src/Kernel/GraphQL/GraphQLViewerEndpointTest.php \Drupal\Tests\social_user\Kernel\GraphQL\GraphQLViewerEndpointTest
- 10.0.x modules/social_features/social_user/tests/src/Kernel/GraphQL/GraphQLViewerEndpointTest.php \Drupal\Tests\social_user\Kernel\GraphQL\GraphQLViewerEndpointTest
- 10.1.x modules/social_features/social_user/tests/src/Kernel/GraphQL/GraphQLViewerEndpointTest.php \Drupal\Tests\social_user\Kernel\GraphQL\GraphQLViewerEndpointTest
Tests the root viewer endpoint.
@group social_graphql
Hierarchy
- class \Drupal\Tests\social_user\Kernel\GraphQL\GraphQLViewerEndpointTest extends \Drupal\Tests\social_graphql\Kernel\SocialGraphQLTestBase
Expanded class hierarchy of GraphQLViewerEndpointTest
File
- modules/
social_features/ social_user/ tests/ src/ Kernel/ GraphQL/ GraphQLViewerEndpointTest.php, line 12
Namespace
Drupal\Tests\social_user\Kernel\GraphQLView source
class GraphQLViewerEndpointTest extends SocialGraphQLTestBase {
/**
* {@inheritdoc}
*/
public static $modules = [
"social_user",
// User creation in social_user requires a service in role_delegation.
// TODO: Possibly untangle this?
"role_delegation",
];
/**
* It loads the current user.
*/
public function testViewerLoadsCurrentUser() : void {
$user = $this
->createUser();
$this
->setCurrentUser($user);
$this
->assertResults("\n query {\n viewer {\n id\n }\n }\n ", [], [
'viewer' => [
'id' => $user
->uuid(),
],
], $this
->defaultCacheMetaData()
->setCacheMaxAge(0)
->addCacheableDependency($user)
->addCacheContexts([
'languages:language_interface',
]));
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
GraphQLViewerEndpointTest:: |
public static | property | ||
GraphQLViewerEndpointTest:: |
public | function | It loads the current user. |