GraphQLCoreTestBase   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
c 2
b 0
f 0
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 11 1
1
<?php
2
3
namespace Drupal\Tests\graphql_core\Kernel;
4
5
use Drupal\Tests\graphql\Kernel\GraphQLTestBase;
0 ignored issues
show
Bug introduced by
The type Drupal\Tests\graphql\Kernel\GraphQLTestBase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Component\HttpFoundation\Session\Session;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\HttpFoundation\Session\Session was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * Test base for drupal core graphql functionality.
10
 */
11
class GraphQLCoreTestBase extends GraphQLTestBase {
12
13
  /**
14
   * {@inheritdoc}
15
   */
16
  public static $modules = [
17
    'graphql_core',
18
    'path_alias',
19
    'user',
20
  ];
21
22
  /**
23
   * {@inheritdoc}
24
   */
25
  protected function setUp(): void {
26
    parent::setUp();
27
    // User entity schema is required for the currentUserContext field.
28
    $this->container->get('module_handler')->loadInclude('user', 'install');
29
    $this->installEntitySchema('user');
30
    user_install();
0 ignored issues
show
Bug introduced by
The function user_install was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
    /** @scrutinizer ignore-call */ 
31
    user_install();
Loading history...
31
32
    // Init session.
33
    $request = $this->container->get('request_stack')->getCurrentRequest();
34
    $session = new Session();
35
    $request->setSession($session);
36
  }
37
38
}
39