File tree 1 file changed +25
-1
lines changed
tests/src/Kernel/DataProducer
1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 5
5
use Drupal \Core \Field \FieldStorageDefinitionInterface ;
6
6
use Drupal \node \Entity \Node ;
7
7
use Drupal \node \Entity \NodeType ;
8
- use Drupal \Tests \field \Traits \EntityReferenceFieldCreationTrait ;
9
8
use Drupal \Tests \graphql \Kernel \GraphQLTestBase ;
10
9
10
+ // @todo Drupal 10.1 compatibility: use the deprecated trait for Drupal 10.1.
11
+ if (strpos (\Drupal::VERSION , '10.1 ' ) === 0 ) {
12
+
13
+ /**
14
+ * Helper trait for compatibility with Drupal 9.
15
+ *
16
+ * @phpcs:disable Drupal.Classes.ClassFileName.NoMatch
17
+ */
18
+ trait EntityReferenceFieldCreationTrait {
19
+ // @phpstan-ignore-next-line
20
+ use \Drupal \Tests \field \Traits \EntityReferenceTestTrait;
21
+
22
+ }
23
+ }
24
+ else {
25
+
26
+ /**
27
+ * Helper trait for compatibility with Drupal 10.
28
+ */
29
+ trait EntityReferenceFieldCreationTrait {
30
+ use \Drupal \Tests \field \Traits \EntityReferenceFieldCreationTrait;
31
+
32
+ }
33
+ }
34
+
11
35
/**
12
36
* Tests the entity_reference data producers.
13
37
*
You can’t perform that action at this time.
0 commit comments