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 | 'node', |
||
27 | 'field', |
||
28 | 'filter', |
||
29 | 'text', |
||
30 | ]; |
||
31 | |||
32 | protected function defaultCacheContexts() { |
||
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | */ |
||
41 | protected function defaultCacheTags() { |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | * |
||
50 | * Add the 'access content' permission to the mocked account. |
||
51 | */ |
||
52 | protected function userPermissions() { |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | protected function setUp() { |
||
75 | |||
76 | /** |
||
77 | * Mock a field that emits a test node. |
||
78 | * |
||
79 | * ``` |
||
80 | * query { |
||
81 | * node { |
||
82 | * title |
||
83 | * } |
||
84 | * } |
||
85 | * ``` |
||
86 | * |
||
87 | * @param mixed $values |
||
88 | * Additional node values. |
||
89 | * @param string $title |
||
90 | * An optional title. Will default to "Test". |
||
91 | */ |
||
92 | protected function mockNode($values, $title = 'Test') { |
||
101 | |||
102 | /** |
||
103 | * Add a field to test content type. |
||
104 | * |
||
105 | * @param string $type |
||
106 | * Field type. |
||
107 | * @param string $fieldName |
||
108 | * Field machine name. |
||
109 | * @param string $label |
||
110 | * Label for the field. |
||
111 | */ |
||
112 | protected function addField($type, $fieldName, $multi = TRUE, $label = 'Label', $bundle = 'test') { |
||
127 | |||
128 | } |
||
129 |