@@ -26,6 +26,7 @@ class PermissionEventTest extends KernelTestBase {
26
26
* {@inheritdoc}
27
27
*/
28
28
public static $ modules = [
29
+ 'entity_test ' ,
29
30
'field ' ,
30
31
'node ' ,
31
32
'og ' ,
@@ -61,6 +62,9 @@ protected function setUp(): void {
61
62
'type ' => 'test_group_content ' ,
62
63
'name ' => 'Test Group Content ' ,
63
64
])->save ();
65
+ // Create two entity_test bundles to test a mixed entity type case.
66
+ entity_test_create_bundle ('a_bundle ' , 'A bundle ' );
67
+ entity_test_create_bundle ('other_bundle ' , 'Other bundle ' );
64
68
}
65
69
66
70
/**
@@ -200,6 +204,37 @@ public function permissionEventDataProvider() {
200
204
$ group_content_operation_permission ,
201
205
],
202
206
],
207
+ // Test a combination of bundles coming from different entity types.
208
+ [
209
+ [
210
+ 'node ' => ['test_group_content ' ],
211
+ 'entity_test ' => ['a_bundle ' , 'other_bundle ' ],
212
+ ],
213
+ array_merge ($ default_permissions , [
214
+ // node:test_group_content.
215
+ 'create test_group_content content ' ,
216
+ 'delete any test_group_content content ' ,
217
+ 'delete own test_group_content content ' ,
218
+ 'edit any test_group_content content ' ,
219
+ 'edit own test_group_content content ' ,
220
+ // entity_test:a_bundle.
221
+ 'create a_bundle entity_test ' ,
222
+ 'delete any a_bundle entity_test ' ,
223
+ 'delete own a_bundle entity_test ' ,
224
+ 'update any a_bundle entity_test ' ,
225
+ 'update own a_bundle entity_test ' ,
226
+ // entity_test:other_bundle.
227
+ 'create other_bundle entity_test ' ,
228
+ 'delete any other_bundle entity_test ' ,
229
+ 'delete own other_bundle entity_test ' ,
230
+ 'update any other_bundle entity_test ' ,
231
+ 'update own other_bundle entity_test ' ,
232
+ ]),
233
+ [
234
+ $ group_level_permission ,
235
+ $ group_content_operation_permission ,
236
+ ],
237
+ ],
203
238
];
204
239
}
205
240
0 commit comments