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 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | protected function defaultCacheTags() { |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | * |
||
44 | * Add the 'access content' permission to the mocked account. |
||
45 | */ |
||
46 | protected function userPermissions() { |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | protected function setUp() { |
||
69 | |||
70 | /** |
||
71 | * Mock a field that emits a test node. |
||
72 | * |
||
73 | * ``` |
||
74 | * query { |
||
75 | * node { |
||
76 | * title |
||
77 | * } |
||
78 | * } |
||
79 | * ``` |
||
80 | * |
||
81 | * @param mixed $values |
||
82 | * Additional node values. |
||
83 | * @param string $title |
||
84 | * An optional title. Will default to "Test". |
||
85 | */ |
||
86 | protected function mockNode($values, $title = 'Test') { |
||
95 | |||
96 | /** |
||
97 | * Add a field to test content type. |
||
98 | * |
||
99 | * @param string $type |
||
100 | * Field type. |
||
101 | * @param string $fieldName |
||
102 | * Field machine name. |
||
103 | * @param string $label |
||
104 | * Label for the field. |
||
105 | */ |
||
106 | protected function addField($type, $fieldName, $multi = TRUE, $label = 'Label', $bundle = 'test') { |
||
121 | |||
122 | } |
||
123 |