2 // @codingStandardsIgnoreFile
5 * Content for the update path test in #2941736.
7 * @see \Drupal\Tests\content_moderation\Functional\DefaultContentModerationStateRevisionUpdateTest.
10 use Drupal\Core\Database\Database;
12 $connection = Database::getConnection();
14 $connection->insert('block_content')
25 'type' => 'test_block_content',
26 'uuid' => '811fac6c-8184-4de5-99eb-9e70d28709f4',
32 'type' => 'test_block_content',
33 'uuid' => 'b89f025c-0538-4075-bd8e-96acf74211c9',
39 'type' => 'test_block_content',
40 'uuid' => '62e428e1-88a6-478c-a8c6-a554ca2332ae',
45 $connection->insert('block_content_field_data')
54 'revision_translation_affected',
59 'type' => 'test_block_content',
61 'info' => 'draft pending revision',
62 'changed' => '1517725800',
63 'default_langcode' => '1',
64 'revision_translation_affected' => '1',
69 'type' => 'test_block_content',
71 'info' => 'published default revision',
72 'changed' => '1517725800',
73 'default_langcode' => '1',
74 'revision_translation_affected' => '1',
79 'type' => 'test_block_content',
81 'info' => 'archived default revision',
82 'changed' => '1517725800',
83 'default_langcode' => '1',
84 'revision_translation_affected' => '1',
88 $connection->insert('block_content_field_revision')
96 'revision_translation_affected',
100 'revision_id' => '1',
102 'info' => 'draft pending revision',
103 'changed' => '1517725800',
104 'default_langcode' => '1',
105 'revision_translation_affected' => '1',
109 'revision_id' => '2',
111 'info' => 'draft pending revision',
112 'changed' => '1517725800',
113 'default_langcode' => '1',
114 'revision_translation_affected' => '1',
118 'revision_id' => '3',
120 'info' => 'published default revision',
121 'changed' => '1517725800',
122 'default_langcode' => '1',
123 'revision_translation_affected' => '1',
127 'revision_id' => '4',
129 'info' => 'archived default revision',
130 'changed' => '1517725800',
131 'default_langcode' => '1',
132 'revision_translation_affected' => '1',
136 'revision_id' => '5',
138 'info' => 'archived default revision',
139 'changed' => '1517725800',
140 'default_langcode' => '1',
141 'revision_translation_affected' => '1',
145 $connection->insert('block_content_revision')
156 'revision_id' => '1',
158 'revision_user' => NULL,
159 'revision_created' => '1517725800',
160 'revision_log' => NULL,
164 'revision_id' => '2',
166 'revision_user' => NULL,
167 'revision_created' => '1517725800',
168 'revision_log' => NULL,
172 'revision_id' => '3',
174 'revision_user' => NULL,
175 'revision_created' => '1517725800',
176 'revision_log' => NULL,
180 'revision_id' => '4',
182 'revision_user' => NULL,
183 'revision_created' => '1517725800',
184 'revision_log' => NULL,
188 'revision_id' => '5',
190 'revision_user' => NULL,
191 'revision_created' => '1517725800',
192 'revision_log' => NULL,
196 $connection->delete('config')
197 ->condition('name', ['workflows.workflow.editorial'], 'IN')
200 $connection->insert('config')
208 'name' => 'block_content.type.test_block_content',
209 'data' => 'a:8:{s:4:"uuid";s:36:"966baba6-525e-48fe-b8c5-a5f131b1857f";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:0:{}s:2:"id";s:18:"test_block_content";s:5:"label";s:18:"Test Block Content";s:8:"revision";N;s:11:"description";N;}',
213 'name' => 'workflows.workflow.editorial',
214 'data' => 'a:9:{s:4:"uuid";s:36:"08b548c7-ff59-468b-9347-7d697680d035";s:8:"langcode";s:2:"en";s:6:"status";b:1;s:12:"dependencies";a:2:{s:6:"config";a:2:{i:0;s:37:"block_content.type.test_block_content";i:1;s:17:"node.type.article";}s:6:"module";a:1:{i:0;s:18:"content_moderation";}}s:5:"_core";a:1:{s:19:"default_config_hash";s:43:"T_JxNjYlfoRBi7Bj1zs5Xv9xv1btuBkKp5C1tNrjMhI";}s:2:"id";s:9:"editorial";s:5:"label";s:9:"Editorial";s:4:"type";s:18:"content_moderation";s:13:"type_settings";a:3:{s:6:"states";a:3:{s:8:"archived";a:4:{s:5:"label";s:8:"Archived";s:6:"weight";i:5;s:9:"published";b:0;s:16:"default_revision";b:1;}s:5:"draft";a:4:{s:5:"label";s:5:"Draft";s:9:"published";b:0;s:16:"default_revision";b:0;s:6:"weight";i:-5;}s:9:"published";a:4:{s:5:"label";s:9:"Published";s:9:"published";b:1;s:16:"default_revision";b:1;s:6:"weight";i:0;}}s:11:"transitions";a:5:{s:7:"archive";a:4:{s:5:"label";s:7:"Archive";s:4:"from";a:1:{i:0;s:9:"published";}s:2:"to";s:8:"archived";s:6:"weight";i:2;}s:14:"archived_draft";a:4:{s:5:"label";s:16:"Restore to Draft";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:5:"draft";s:6:"weight";i:3;}s:18:"archived_published";a:4:{s:5:"label";s:7:"Restore";s:4:"from";a:1:{i:0;s:8:"archived";}s:2:"to";s:9:"published";s:6:"weight";i:4;}s:16:"create_new_draft";a:4:{s:5:"label";s:16:"Create New Draft";s:2:"to";s:5:"draft";s:6:"weight";i:0;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}s:7:"publish";a:4:{s:5:"label";s:7:"Publish";s:2:"to";s:9:"published";s:6:"weight";i:1;s:4:"from";a:2:{i:0;s:5:"draft";i:1;s:9:"published";}}}s:12:"entity_types";a:2:{s:13:"block_content";a:1:{i:0;s:18:"test_block_content";}s:4:"node";a:1:{i:0;s:7:"article";}}}}',
218 $connection->insert('content_moderation_state')
227 'revision_id' => '2',
228 'uuid' => '3ce04732-f65f-4937-aa49-821f5842ae06',
233 'revision_id' => '3',
234 'uuid' => 'a6507b55-3001-4748-8d32-f4fa47319754',
239 'revision_id' => '5',
240 'uuid' => '112d2bd2-552b-4e2f-9a6d-526740ba1b38',
245 'revision_id' => '7',
246 'uuid' => 'a85d0d06-e046-4509-b9b4-75d78dcdd91e',
251 'revision_id' => '8',
252 'uuid' => '3797f5de-116b-4d75-b7e3-5206e6f97c41',
257 'revision_id' => '10',
258 'uuid' => '8d9b11c1-8ddf-4c61-bb8d-9ac724e28d9e',
263 $connection->insert('content_moderation_state_field_data')
271 'content_entity_type_id',
273 'content_entity_revision_id',
275 'revision_translation_affected',
279 'revision_id' => '2',
282 'workflow' => 'editorial',
283 'moderation_state' => 'draft',
284 'content_entity_type_id' => 'node',
285 'content_entity_id' => '1',
286 'content_entity_revision_id' => '2',
287 'default_langcode' => '1',
288 'revision_translation_affected' => '1',
292 'revision_id' => '3',
295 'workflow' => 'editorial',
296 'moderation_state' => 'published',
297 'content_entity_type_id' => 'node',
298 'content_entity_id' => '2',
299 'content_entity_revision_id' => '3',
300 'default_langcode' => '1',
301 'revision_translation_affected' => '1',
305 'revision_id' => '5',
308 'workflow' => 'editorial',
309 'moderation_state' => 'archived',
310 'content_entity_type_id' => 'node',
311 'content_entity_id' => '3',
312 'content_entity_revision_id' => '5',
313 'default_langcode' => '1',
314 'revision_translation_affected' => '1',
318 'revision_id' => '7',
321 'workflow' => 'editorial',
322 'moderation_state' => 'draft',
323 'content_entity_type_id' => 'block_content',
324 'content_entity_id' => '1',
325 'content_entity_revision_id' => '2',
326 'default_langcode' => '1',
327 'revision_translation_affected' => '1',
331 'revision_id' => '8',
334 'workflow' => 'editorial',
335 'moderation_state' => 'published',
336 'content_entity_type_id' => 'block_content',
337 'content_entity_id' => '2',
338 'content_entity_revision_id' => '3',
339 'default_langcode' => '1',
340 'revision_translation_affected' => '1',
344 'revision_id' => '10',
347 'workflow' => 'editorial',
348 'moderation_state' => 'archived',
349 'content_entity_type_id' => 'block_content',
350 'content_entity_id' => '3',
351 'content_entity_revision_id' => '5',
352 'default_langcode' => '1',
353 'revision_translation_affected' => '1',
357 $connection->insert('content_moderation_state_field_revision')
365 'content_entity_type_id',
367 'content_entity_revision_id',
369 'revision_translation_affected',
373 'revision_id' => '1',
376 'workflow' => 'editorial',
377 'moderation_state' => 'published',
378 'content_entity_type_id' => 'node',
379 'content_entity_id' => '1',
380 'content_entity_revision_id' => '1',
381 'default_langcode' => '1',
382 'revision_translation_affected' => '1',
386 'revision_id' => '2',
389 'workflow' => 'editorial',
390 'moderation_state' => 'draft',
391 'content_entity_type_id' => 'node',
392 'content_entity_id' => '1',
393 'content_entity_revision_id' => '2',
394 'default_langcode' => '1',
395 'revision_translation_affected' => '1',
399 'revision_id' => '3',
402 'workflow' => 'editorial',
403 'moderation_state' => 'published',
404 'content_entity_type_id' => 'node',
405 'content_entity_id' => '2',
406 'content_entity_revision_id' => '3',
407 'default_langcode' => '1',
408 'revision_translation_affected' => '1',
412 'revision_id' => '4',
415 'workflow' => 'editorial',
416 'moderation_state' => 'published',
417 'content_entity_type_id' => 'node',
418 'content_entity_id' => '3',
419 'content_entity_revision_id' => '4',
420 'default_langcode' => '1',
421 'revision_translation_affected' => '1',
425 'revision_id' => '5',
428 'workflow' => 'editorial',
429 'moderation_state' => 'archived',
430 'content_entity_type_id' => 'node',
431 'content_entity_id' => '3',
432 'content_entity_revision_id' => '5',
433 'default_langcode' => '1',
434 'revision_translation_affected' => '1',
438 'revision_id' => '6',
441 'workflow' => 'editorial',
442 'moderation_state' => 'published',
443 'content_entity_type_id' => 'block_content',
444 'content_entity_id' => '1',
445 'content_entity_revision_id' => '1',
446 'default_langcode' => '1',
447 'revision_translation_affected' => '1',
451 'revision_id' => '7',
454 'workflow' => 'editorial',
455 'moderation_state' => 'draft',
456 'content_entity_type_id' => 'block_content',
457 'content_entity_id' => '1',
458 'content_entity_revision_id' => '2',
459 'default_langcode' => '1',
460 'revision_translation_affected' => '1',
464 'revision_id' => '8',
467 'workflow' => 'editorial',
468 'moderation_state' => 'published',
469 'content_entity_type_id' => 'block_content',
470 'content_entity_id' => '2',
471 'content_entity_revision_id' => '3',
472 'default_langcode' => '1',
473 'revision_translation_affected' => '1',
477 'revision_id' => '9',
480 'workflow' => 'editorial',
481 'moderation_state' => 'published',
482 'content_entity_type_id' => 'block_content',
483 'content_entity_id' => '3',
484 'content_entity_revision_id' => '4',
485 'default_langcode' => '1',
486 'revision_translation_affected' => '1',
490 'revision_id' => '10',
493 'workflow' => 'editorial',
494 'moderation_state' => 'archived',
495 'content_entity_type_id' => 'block_content',
496 'content_entity_id' => '3',
497 'content_entity_revision_id' => '5',
498 'default_langcode' => '1',
499 'revision_translation_affected' => '1',
503 $connection->insert('content_moderation_state_revision')
511 'revision_id' => '1',
516 'revision_id' => '2',
521 'revision_id' => '3',
526 'revision_id' => '4',
531 'revision_id' => '5',
536 'revision_id' => '6',
541 'revision_id' => '7',
546 'revision_id' => '8',
551 'revision_id' => '9',
556 'revision_id' => '10',
561 $connection->insert('key_value')
568 'collection' => 'config.entity.key_store.block_content_type',
569 'name' => 'uuid:966baba6-525e-48fe-b8c5-a5f131b1857f',
570 'value' => 'a:1:{i:0;s:37:"block_content.type.test_block_content";}',
574 $connection->insert('node')
586 'uuid' => '11143847-fe18-4808-a797-8b15966adf4c',
593 'uuid' => '336e6941-9340-419e-a763-65d4c11ea031',
600 'uuid' => '3eebe337-f977-4a32-94d2-4095947f125d',
605 $connection->insert('node_field_data')
619 'revision_translation_affected',
627 'title' => 'draft pending revision',
629 'created' => '1517725800',
630 'changed' => '1517725800',
633 'default_langcode' => '1',
634 'revision_translation_affected' => '1',
642 'title' => 'published default revision',
644 'created' => '1517725800',
645 'changed' => '1517725800',
648 'default_langcode' => '1',
649 'revision_translation_affected' => '1',
657 'title' => 'archived default revision',
659 'created' => '1517725800',
660 'changed' => '1517725800',
663 'default_langcode' => '1',
664 'revision_translation_affected' => '1',
668 $connection->insert('node_field_revision')
681 'revision_translation_affected',
688 'title' => 'draft pending revision',
690 'created' => '1517725800',
691 'changed' => '1517725800',
694 'default_langcode' => '1',
695 'revision_translation_affected' => '1',
702 'title' => 'draft pending revision',
704 'created' => '1517725800',
705 'changed' => '1517725800',
708 'default_langcode' => '1',
709 'revision_translation_affected' => '1',
716 'title' => 'published default revision',
718 'created' => '1517725800',
719 'changed' => '1517725800',
722 'default_langcode' => '1',
723 'revision_translation_affected' => '1',
730 'title' => 'archived default revision',
732 'created' => '1517725800',
733 'changed' => '1517725800',
736 'default_langcode' => '1',
737 'revision_translation_affected' => '1',
744 'title' => 'archived default revision',
746 'created' => '1517725800',
747 'changed' => '1517725800',
750 'default_langcode' => '1',
751 'revision_translation_affected' => '1',
755 $connection->insert('node_revision')
761 'revision_timestamp',
768 'revision_uid' => '0',
769 'revision_timestamp' => '1517725800',
770 'revision_log' => NULL,
776 'revision_uid' => '0',
777 'revision_timestamp' => '1517725800',
778 'revision_log' => NULL,
784 'revision_uid' => '0',
785 'revision_timestamp' => '1517725800',
786 'revision_log' => NULL,
792 'revision_uid' => '0',
793 'revision_timestamp' => '1517725800',
794 'revision_log' => NULL,
800 'revision_uid' => '0',
801 'revision_timestamp' => '1517725800',
802 'revision_log' => NULL,