trait EnableCliCacheTrait in GraphQL 8.3
Trait to automatically enable CLI caching in GraphQL tests.
Hierarchy
- trait \Drupal\Tests\graphql\Traits\EnableCliCacheTrait
1 file declares its use of EnableCliCacheTrait
- GraphQLTestBase.php in tests/src/ Kernel/ GraphQLTestBase.php 
File
- tests/src/ Traits/ EnableCliCacheTrait.php, line 11 
Namespace
Drupal\Tests\graphql\TraitsView source
trait EnableCliCacheTrait {
  /**
   * Enable caching in CLI environments.
   */
  protected function enableCliCache() {
    // Disable the cli deny policy because we actually want caching on cli
    // when kernel testing it.
    $cliPolicy = $this
      ->prophesize(RequestPolicyInterface::class);
    $cliPolicy
      ->check(Argument::cetera())
      ->willReturn(NULL);
    $this->container
      ->set('graphql.request_policy.deny_command_line', $cliPolicy
      ->reveal());
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| EnableCliCacheTrait:: | protected | function | Enable caching in CLI environments. | 
