1 | <?php |
||
16 | class GraphQLContentTestBase extends GraphQLCoreTestBase { |
||
17 | use ContentTypeCreationTrait; |
||
18 | use UserCreationTrait; |
||
19 | use NodeCreationTrait; |
||
20 | use RevisionsTestTrait; |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | public static $modules = [ |
||
26 | 'content_translation', |
||
27 | 'node', |
||
28 | 'field', |
||
29 | 'filter', |
||
30 | 'text', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | protected function defaultCacheTags() { |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | * |
||
45 | * Add the 'access content' permission to the mocked account. |
||
46 | */ |
||
47 | protected function userPermissions() { |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | protected function setUp() { |
||
73 | |||
74 | /** |
||
75 | * Mock a field that emits a test node. |
||
76 | * |
||
77 | * ``` |
||
78 | * query { |
||
79 | * node { |
||
80 | * title |
||
81 | * } |
||
82 | * } |
||
83 | * ``` |
||
84 | * |
||
85 | * @param mixed $values |
||
86 | * Additional node values. |
||
87 | * @param string $title |
||
88 | * An optional title. Will default to "Test". |
||
89 | */ |
||
90 | protected function mockNode($values, $title = 'Test') { |
||
99 | |||
100 | /** |
||
101 | * Add a field to test content type. |
||
102 | * |
||
103 | * @param string $type |
||
104 | * Field type. |
||
105 | * @param string $fieldName |
||
106 | * Field machine name. |
||
107 | * @param string $label |
||
108 | * Label for the field. |
||
109 | */ |
||
110 | protected function addField($type, $fieldName, $multi = TRUE, $label = 'Label', $bundle = 'test') { |
||
125 | |||
126 | } |
||
127 |