3 namespace Drupal\Tests\ctools\Kernel;
6 use Drupal\ctools\Testing\EntityCreationTrait;
7 use Drupal\KernelTests\KernelTestBase;
9 abstract class RelationshipsTestBase extends KernelTestBase {
10 use EntityCreationTrait;
13 * @var \Drupal\ctools\Plugin\RelationshipManagerInterface
15 protected $relationshipManager;
18 * @var \Drupal\Core\Entity\EntityInterface[]
20 protected $entities = [];
27 public static $modules = [
40 protected function setUp() {
43 $this->installSchema('system', ['sequences', 'router']);
44 $this->installEntitySchema('user');
45 $this->installEntitySchema('node_type');
46 $this->installEntitySchema('node');
47 $this->installConfig('node');
48 $page = $this->createEntity('node_type', [
52 node_add_body_field($page);
53 $article = $this->createEntity('node_type', [
57 // Not adding the body field the articles so that we can perform a test.
58 $foo = $this->createEntity('node_type', [
62 node_add_body_field($foo);
63 $this->relationshipManager = $this->container->get('plugin.manager.ctools.relationship');
65 $user = $this->createEntity('user', [
66 'name' => 'test_user',
67 'password' => 'password',
68 'mail' => 'mail@test.com',
71 $node1 = $this->createEntity('node', [
75 'body' => 'This is a test',
77 $node2 = $this->createEntity('node', [
82 $node3 = $this->createEntity('node', [