Skip to content

Commit ea48879

Browse files
committed
revert EntityReferenceTest
1 parent b2ae4fe commit ea48879

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

tests/src/Kernel/DataProducer/EntityReferenceTest.php

+25-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,33 @@
55
use Drupal\Core\Field\FieldStorageDefinitionInterface;
66
use Drupal\node\Entity\Node;
77
use Drupal\node\Entity\NodeType;
8-
use Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait;
98
use Drupal\Tests\graphql\Kernel\GraphQLTestBase;
109

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+
1135
/**
1236
* Tests the entity_reference data producers.
1337
*

0 commit comments

Comments
 (0)