Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / ctools / tests / src / Kernel / RelationshipsTestBase.php
1 <?php
2
3 namespace Drupal\Tests\ctools\Kernel;
4
5
6 use Drupal\ctools\Testing\EntityCreationTrait;
7 use Drupal\KernelTests\KernelTestBase;
8
9 abstract class RelationshipsTestBase extends KernelTestBase {
10   use EntityCreationTrait;
11
12   /**
13    * @var \Drupal\ctools\Plugin\RelationshipManagerInterface
14    */
15   protected $relationshipManager;
16
17   /**
18    * @var \Drupal\Core\Entity\EntityInterface[]
19    */
20   protected $entities = [];
21
22   /**
23    * Modules to enable.
24    *
25    * @var array
26    */
27   public static $modules = [
28     'user',
29     'system',
30     'node',
31     'field',
32     'text',
33     'filter',
34     'ctools'
35   ];
36
37   /**
38    * {@inheritdoc}
39    */
40   protected function setUp() {
41     parent::setUp();
42
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', [
49       'type' => 'page',
50       'name' => 'Page'
51     ]);
52     node_add_body_field($page);
53     $article = $this->createEntity('node_type', [
54       'type' => 'article',
55       'name' => 'Article'
56     ]);
57     // Not adding the body field the articles so that we can perform a test.
58     $foo = $this->createEntity('node_type', [
59       'type' => 'foo',
60       'name' => 'Foo'
61     ]);
62     node_add_body_field($foo);
63     $this->relationshipManager = $this->container->get('plugin.manager.ctools.relationship');
64
65     $user = $this->createEntity('user', [
66       'name' => 'test_user',
67       'password' => 'password',
68       'mail' => 'mail@test.com',
69       'status' => 1,
70     ]);
71     $node1 = $this->createEntity('node', [
72       'title' => 'Node 1',
73       'type' => 'page',
74       'uid' => $user->id(),
75       'body' => 'This is a test',
76     ]);
77     $node2 = $this->createEntity('node', [
78       'title' => 'Node 2',
79       'type' => 'article',
80       'uid' => $user->id()
81     ]);
82     $node3 = $this->createEntity('node', [
83       'title' => 'Node 3',
84       'type' => 'foo',
85       'uid' => $user->id()
86     ]);
87
88     $this->entities = [
89       'user' => $user,
90       'node1' => $node1,
91       'node2' => $node2,
92       'node3' => $node3,
93     ];
94   }
95
96 }