‪TYPO3CMS  ‪main
CKEditor5MigratorTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
24 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
25 
26 final class ‪CKEditor5MigratorTest extends UnitTestCase
27 {
28  public static function ‪migrationDataProvider(): array
29  {
30  return [
31  'empty' => [
32  [
33  'editor' => [
34  'config' => [
35  ],
36  ],
37  ],
38  [
39  'editor' => [
40  'config' => [
41  'toolbar' => [
42  'items' => [
43  'softhyphen',
44  ],
45  'removeItems' => [],
46  'shouldNotGroupWhenFull' => true,
47  ],
48  'alignment' => [
49  'options' => [
50  ['name' => 'left', 'className' => 'text-start'],
51  ['name' => 'center', 'className' => 'text-center'],
52  ['name' => 'right', 'className' => 'text-end'],
53  ['name' => 'justify', 'className' => 'text-justify'],
54  ],
55  ],
56  'wordCount' => [
57  'displayCharacters' => true,
58  'displayWords' => true,
59  ],
60  ],
61  ],
62  ],
63  ],
64 
65  // Remove Plugins
66  'Remove plugins mapping' => [
67  [
68  'editor' => [
69  'config' => [
70  'removePlugins' => ['image'],
71  ],
72  ],
73  ],
74  [
75  'editor' => [
76  'config' => [
77  'removeImportModules' => [
78  [
79  'module' => '@ckeditor/ckeditor5-image',
80  'exports' => [ 'Image', 'ImageCaption', 'ImageStyle', 'ImageToolbar', 'ImageUpload', 'PictureEditing' ],
81  ],
82  ],
83  'toolbar' => [
84  'items' => [
85  'softhyphen',
86  ],
87  'removeItems' => [],
88  'shouldNotGroupWhenFull' => true,
89  ],
90  'alignment' => [
91  'options' => [
92  ['name' => 'left', 'className' => 'text-start'],
93  ['name' => 'center', 'className' => 'text-center'],
94  ['name' => 'right', 'className' => 'text-end'],
95  ['name' => 'justify', 'className' => 'text-justify'],
96  ],
97  ],
98  'wordCount' => [
99  'displayCharacters' => true,
100  'displayWords' => true,
101  ],
102  ],
103  ],
104  ],
105  ],
106 
107  // Remove Plugins, preserving array-list structure
108  'Remove plugins mapping preserves array-list structure' => [
109  [
110  'editor' => [
111  'config' => [
112  'removePlugins' => [
113  'image',
114  'foobar',
115  ],
116  ],
117  ],
118  ],
119  [
120  'editor' => [
121  'config' => [
122  'removePlugins' => [
123  'foobar',
124  ],
125  'removeImportModules' => [
126  [
127  'module' => '@ckeditor/ckeditor5-image',
128  'exports' => [ 'Image', 'ImageCaption', 'ImageStyle', 'ImageToolbar', 'ImageUpload', 'PictureEditing' ],
129  ],
130  ],
131  'toolbar' => [
132  'items' => [
133  'softhyphen',
134  ],
135  'removeItems' => [],
136  'shouldNotGroupWhenFull' => true,
137  ],
138  'alignment' => [
139  'options' => [
140  ['name' => 'left', 'className' => 'text-start'],
141  ['name' => 'center', 'className' => 'text-center'],
142  ['name' => 'right', 'className' => 'text-end'],
143  ['name' => 'justify', 'className' => 'text-justify'],
144  ],
145  ],
146  'wordCount' => [
147  'displayCharacters' => true,
148  'displayWords' => true,
149  ],
150  ],
151  ],
152  ],
153  ],
154 
155  // Remove Buttons. Configured as array
156  'Remove buttons mapping (array)' => [
157  [
158  'editor' => [
159  'config' => [
160  'removeButtons' => [
161  'Anchor',
162  'Superscript',
163  'Subscript',
164  'Underline',
165  'Strike',
166  'Styles',
167  ],
168  ],
169  ],
170  ],
171  [
172  'editor' => [
173  'config' => [
174  'toolbar' => [
175  'items' => [
176  'softhyphen',
177  ],
178  'removeItems' => [
179  'superscript',
180  'subscript',
181  'underline',
182  'strikethrough',
183  'style',
184  ],
185  'shouldNotGroupWhenFull' => true,
186  ],
187  'alignment' => [
188  'options' => [
189  ['name' => 'left', 'className' => 'text-start'],
190  ['name' => 'center', 'className' => 'text-center'],
191  ['name' => 'right', 'className' => 'text-end'],
192  ['name' => 'justify', 'className' => 'text-justify'],
193  ],
194  ],
195  'wordCount' => [
196  'displayCharacters' => true,
197  'displayWords' => true,
198  ],
199  ],
200  ],
201  ],
202  ],
203 
204  // Remove Buttons. Configured as string
205  'Remove buttons mapping (string)' => [
206  [
207  'editor' => [
208  'config' => [
209  'removeButtons' => 'Anchor,Superscript,Subscript,Underline,Strike,Styles',
210  ],
211  ],
212  ],
213  [
214  'editor' => [
215  'config' => [
216  'toolbar' => [
217  'items' => [
218  'softhyphen',
219  ],
220  'removeItems' => [
221  'superscript',
222  'subscript',
223  'underline',
224  'strikethrough',
225  'style',
226  ],
227  'shouldNotGroupWhenFull' => true,
228  ],
229  'alignment' => [
230  'options' => [
231  ['name' => 'left', 'className' => 'text-start'],
232  ['name' => 'center', 'className' => 'text-center'],
233  ['name' => 'right', 'className' => 'text-end'],
234  ['name' => 'justify', 'className' => 'text-justify'],
235  ],
236  ],
237  'wordCount' => [
238  'displayCharacters' => true,
239  'displayWords' => true,
240  ],
241  ],
242  ],
243  ],
244  ],
245 
246  // Toolbar migration
247  'CKEditor4 Toolbar Basic' => [
248  [
249  'editor' => [
250  'config' => [
251  'toolbar' => [
252  ['Bold', 'Italic', '-', 'Underline', 'Strike'],
253  ['Subscript', 'Superscript', 'SoftHyphen'],
254  '/',
255  ['NumberedList', 'BulletedList'],
256  ],
257  ],
258  ],
259  ],
260  [
261  'editor' => [
262  'config' => [
263  'toolbar' => [
264  'items' => [
265  'bold',
266  'italic',
267  '|',
268  'underline',
269  'strikethrough',
270  '|',
271  'subscript',
272  'superscript',
273  'softhyphen',
274  '-',
275  'numberedList',
276  'bulletedList',
277  ],
278  'removeItems' => [],
279  'shouldNotGroupWhenFull' => true,
280  ],
281  'alignment' => [
282  'options' => [
283  ['name' => 'left', 'className' => 'text-start'],
284  ['name' => 'center', 'className' => 'text-center'],
285  ['name' => 'right', 'className' => 'text-end'],
286  ['name' => 'justify', 'className' => 'text-justify'],
287  ],
288  ],
289  'wordCount' => [
290  'displayCharacters' => true,
291  'displayWords' => true,
292  ],
293  ],
294  ],
295  ],
296  ],
297  'CKEditor4 Toolbar Advanced' => [
298  [
299  'editor' => [
300  'config' => [
301  'toolbar' => [
302  [
303  'name' => 'basicstyles',
304  'items' => [
305  'Bold',
306  'Italic',
307  '-',
308  'Underline',
309  'Strike',
310  '-',
311  'Subscript',
312  'Superscript',
313  'SoftHyphen',
314  ],
315  ],
316  '/',
317  [
318  'name' => 'list',
319  'items' => [
320  'NumberedList', 'BulletedList',
321  ],
322  ],
323  ],
324  ],
325  ],
326  ],
327  [
328  'editor' => [
329  'config' => [
330  'toolbar' => [
331  'items' => [
332  'bold',
333  'italic',
334  '|',
335  'underline',
336  'strikethrough',
337  '|',
338  'subscript',
339  'superscript',
340  'softhyphen',
341  '-',
342  'numberedList',
343  'bulletedList',
344  ],
345  'removeItems' => [],
346  'shouldNotGroupWhenFull' => true,
347  ],
348  'alignment' => [
349  'options' => [
350  ['name' => 'left', 'className' => 'text-start'],
351  ['name' => 'center', 'className' => 'text-center'],
352  ['name' => 'right', 'className' => 'text-end'],
353  ['name' => 'justify', 'className' => 'text-justify'],
354  ],
355  ],
356  'wordCount' => [
357  'displayCharacters' => true,
358  'displayWords' => true,
359  ],
360  ],
361  ],
362  ],
363  ],
364  'CKEditor4 ToolbarGroups' => [
365  [
366  'editor' => [
367  'config' => [
368  'toolbarGroups' => [
369  [
370  'name' => 'basicstyles',
371  'groups' => ['basicstyles'],
372  ],
373  '/',
374  [
375  'name' => 'paragraph',
376  'groups' => ['list', '-', 'indent', 'blocks', '-', 'align'],
377  ],
378  ],
379  ],
380  ],
381  ],
382  [
383  'editor' => [
384  'config' => [
385  'toolbar' => [
386  'items' => [
387  'bold',
388  'italic',
389  'underline',
390  'strikethrough',
391  'subscript',
392  'superscript',
393  'softhyphen',
394  '-',
395  'numberedList',
396  'bulletedList',
397  '|',
398  'indent',
399  'outdent',
400  '|',
401  'blockQuote',
402  '|',
403  'alignment:left',
404  'alignment:center',
405  'alignment:right',
406  'alignment:justify',
407  ],
408  'removeItems' => [],
409  'shouldNotGroupWhenFull' => true,
410  ],
411  'alignment' => [
412  'options' => [
413  ['name' => 'left', 'className' => 'text-start'],
414  ['name' => 'center', 'className' => 'text-center'],
415  ['name' => 'right', 'className' => 'text-end'],
416  ['name' => 'justify', 'className' => 'text-justify'],
417  ],
418  ],
419  'wordCount' => [
420  'displayCharacters' => true,
421  'displayWords' => true,
422  ],
423  ],
424  ],
425  ],
426  ],
427  'CKEditor4 ToolbarReference' => [
428  [
429  'editor' => [
430  'config' => [
431  'toolbar' => 'Basic',
432  'toolbar_Basic' => [
433  ['Bold', 'Italic', '-', 'Underline', 'Strike'],
434  ['Subscript', 'Superscript', 'SoftHyphen'],
435  '/',
436  ['NumberedList', 'BulletedList'],
437  ],
438  ],
439  ],
440  ],
441  [
442  'editor' => [
443  'config' => [
444  'toolbar' => [
445  'items' => [
446  'bold',
447  'italic',
448  '|',
449  'underline',
450  'strikethrough',
451  '|',
452  'subscript',
453  'superscript',
454  'softhyphen',
455  '-',
456  'numberedList',
457  'bulletedList',
458  ],
459  'removeItems' => [],
460  'shouldNotGroupWhenFull' => true,
461  ],
462  'alignment' => [
463  'options' => [
464  ['name' => 'left', 'className' => 'text-start'],
465  ['name' => 'center', 'className' => 'text-center'],
466  ['name' => 'right', 'className' => 'text-end'],
467  ['name' => 'justify', 'className' => 'text-justify'],
468  ],
469  ],
470  'wordCount' => [
471  'displayCharacters' => true,
472  'displayWords' => true,
473  ],
474  ],
475  ],
476  ],
477  ],
478  'CKEditor5 Flat' => [
479  [
480  'editor' => [
481  'config' => [
482  'toolbar' => [
483  'bold',
484  'italic',
485  '|',
486  'underline',
487  'strikethrough',
488  '|',
489  'subscript',
490  'superscript',
491  'softhyphen',
492  '-',
493  'numberedList',
494  'bulletedList',
495  ],
496  ],
497  ],
498  ],
499  [
500  'editor' => [
501  'config' => [
502  'toolbar' => [
503  'items' => [
504  'bold',
505  'italic',
506  '|',
507  'underline',
508  'strikethrough',
509  '|',
510  'subscript',
511  'superscript',
512  'softhyphen',
513  '-',
514  'numberedList',
515  'bulletedList',
516  ],
517  'removeItems' => [],
518  'shouldNotGroupWhenFull' => true,
519  ],
520  'alignment' => [
521  'options' => [
522  ['name' => 'left', 'className' => 'text-start'],
523  ['name' => 'center', 'className' => 'text-center'],
524  ['name' => 'right', 'className' => 'text-end'],
525  ['name' => 'justify', 'className' => 'text-justify'],
526  ],
527  ],
528  'wordCount' => [
529  'displayCharacters' => true,
530  'displayWords' => true,
531  ],
532  ],
533  ],
534  ],
535  ],
536  'CKEditor5 Nested' => [
537  [
538  'editor' => [
539  'config' => [
540  'toolbar' => [
541  'items' => [
542  'bold',
543  'italic',
544  '|',
545  'underline',
546  'strikethrough',
547  '|',
548  'subscript',
549  'superscript',
550  'softhyphen',
551  '-',
552  'numberedList',
553  'bulletedList',
554  ],
555  ],
556  ],
557  ],
558  ],
559  [
560  'editor' => [
561  'config' => [
562  'toolbar' => [
563  'items' => [
564  'bold',
565  'italic',
566  '|',
567  'underline',
568  'strikethrough',
569  '|',
570  'subscript',
571  'superscript',
572  'softhyphen',
573  '-',
574  'numberedList',
575  'bulletedList',
576  ],
577  'removeItems' => [],
578  'shouldNotGroupWhenFull' => true,
579  ],
580  'alignment' => [
581  'options' => [
582  ['name' => 'left', 'className' => 'text-start'],
583  ['name' => 'center', 'className' => 'text-center'],
584  ['name' => 'right', 'className' => 'text-end'],
585  ['name' => 'justify', 'className' => 'text-justify'],
586  ],
587  ],
588  'wordCount' => [
589  'displayCharacters' => true,
590  'displayWords' => true,
591  ],
592  ],
593  ],
594  ],
595  ],
596  'CKEditor5 Grouped' => [
597  [
598  'editor' => [
599  'config' => [
600  'toolbar' => [
601  'items' => [
602  'bold',
603  'italic',
604  [
605  'label' => 'More basic styles',
606  'icon' => 'threeVerticalDots',
607  'items' => ['strikethrough', 'superscript', 'subscript'],
608  ],
609  ],
610  ],
611  ],
612  ],
613  ],
614  [
615  'editor' => [
616  'config' => [
617  'toolbar' => [
618  'items' => [
619  'bold',
620  'italic',
621  [
622  'label' => 'More basic styles',
623  'icon' => 'threeVerticalDots',
624  'items' => ['strikethrough', 'superscript', 'subscript'],
625  ],
626  'softhyphen',
627  ],
628  'removeItems' => [],
629  'shouldNotGroupWhenFull' => true,
630  ],
631  'alignment' => [
632  'options' => [
633  ['name' => 'left', 'className' => 'text-start'],
634  ['name' => 'center', 'className' => 'text-center'],
635  ['name' => 'right', 'className' => 'text-end'],
636  ['name' => 'justify', 'className' => 'text-justify'],
637  ],
638  ],
639  'wordCount' => [
640  'displayCharacters' => true,
641  'displayWords' => true,
642  ],
643  ],
644  ],
645  ],
646  ],
647  'CKEditor5 toolbar.removeItems and CKEditor4 removeButtons' => [
648  [
649  'editor' => [
650  'config' => [
651  'toolbar' => [
652  'items' => [
653  'bold',
654  ],
655  'removeItems' => [
656  'subscript',
657  'underline',
658  ],
659  ],
660  'removeButtons' => [
661  'Superscript',
662  'Strike',
663  ],
664  ],
665  ],
666  ],
667  [
668  'editor' => [
669  'config' => [
670  'toolbar' => [
671  'items' => [
672  'bold',
673  'softhyphen',
674  ],
675  'removeItems' => [
676  'subscript',
677  'underline',
678  'superscript',
679  'strikethrough',
680  ],
681  'shouldNotGroupWhenFull' => true,
682  ],
683  'alignment' => [
684  'options' => [
685  ['name' => 'left', 'className' => 'text-start'],
686  ['name' => 'center', 'className' => 'text-center'],
687  ['name' => 'right', 'className' => 'text-end'],
688  ['name' => 'justify', 'className' => 'text-justify'],
689  ],
690  ],
691  'wordCount' => [
692  'displayCharacters' => true,
693  'displayWords' => true,
694  ],
695  ],
696  ],
697  ],
698  ],
699  'CKEditor5 shouldNotGroupWhenFull' => [
700  [
701  'editor' => [
702  'config' => [
703  'toolbar' => [
704  'shouldNotGroupWhenFull' => false,
705  ],
706  ],
707  ],
708  ],
709  [
710  'editor' => [
711  'config' => [
712  'toolbar' => [
713  'items' => [
714  'softhyphen',
715  ],
716  'removeItems' => [],
717  'shouldNotGroupWhenFull' => false,
718  ],
719  'alignment' => [
720  'options' => [
721  ['name' => 'left', 'className' => 'text-start'],
722  ['name' => 'center', 'className' => 'text-center'],
723  ['name' => 'right', 'className' => 'text-end'],
724  ['name' => 'justify', 'className' => 'text-justify'],
725  ],
726  ],
727  'wordCount' => [
728  'displayCharacters' => true,
729  'displayWords' => true,
730  ],
731  ],
732  ],
733  ],
734  ],
735 
736  // TYPO3 11.5 Toolbar Presets
737  'CKEditor4 Toolbar Default' => [
738  [
739  'editor' => [
740  'config' => [
741  'toolbarGroups' => [
742  ['name' => 'styles', 'groups' => ['styles', 'format']],
743  ['name' => 'basicstyles', 'groups' => ['basicstyles']],
744  ['name' => 'paragraph', 'groups' => ['list', 'indent', 'blocks', 'align']],
745  ['name' => 'links', 'groups' => ['links']],
746  ['name' => 'clipboard', 'groups' => ['clipboard', 'cleanup', 'undo']],
747  ['name' => 'editing', 'groups' => ['spellchecker']],
748  ['name' => 'insert', 'groups' => ['insert']],
749  ['name' => 'tools', 'groups' => ['table', 'specialchar', 'insertcharacters']],
750  ['name' => 'document', 'groups' => ['mode']],
751  ],
752  ],
753  ],
754  ],
755  [
756  'editor' => [
757  'config' => [
758  'toolbar' => [
759  'items' => [
760  'style',
761  'heading',
762  'fontFamily',
763  'fontSize',
764  '|',
765  'bold',
766  'italic',
767  'underline',
768  'strikethrough',
769  'subscript',
770  'superscript',
771  'softhyphen',
772  '|',
773  'numberedList',
774  'bulletedList',
775  '|',
776  'indent',
777  'outdent',
778  '|',
779  'blockQuote',
780  '|',
781  'alignment:left',
782  'alignment:center',
783  'alignment:right',
784  'alignment:justify',
785  '|',
786  'link',
787  '|',
788  'removeFormat',
789  '|',
790  'undo',
791  'redo',
792  '|',
793  'insertImage',
794  'insertTable',
795  'horizontalLine',
796  'specialCharacters',
797  'pageBreak',
798  '|',
799  'insertcharacters',
800  '|',
801  'sourceEditing',
802  ],
803  'removeItems' => [],
804  'shouldNotGroupWhenFull' => true,
805  ],
806  'alignment' => [
807  'options' => [
808  ['name' => 'left', 'className' => 'text-start'],
809  ['name' => 'center', 'className' => 'text-center'],
810  ['name' => 'right', 'className' => 'text-end'],
811  ['name' => 'justify', 'className' => 'text-justify'],
812  ],
813  ],
814  'wordCount' => [
815  'displayCharacters' => true,
816  'displayWords' => true,
817  ],
818  ],
819  ],
820  ],
821  ],
822  'CKEditor4 Toolbar Full' => [
823  [
824  'editor' => [
825  'config' => [
826  'toolbarGroups' => [
827  ['name' => 'clipboard', 'groups' => ['clipboard', 'undo']],
828  ['name' => 'editing', 'groups' => ['find', 'selection', 'spellchecker']],
829  ['name' => 'links'],
830  ['name' => 'insert'],
831  ['name' => 'tools'],
832  ['name' => 'table'],
833  ['name' => 'tabletools'],
834  ['name' => 'document', 'groups' => ['mode', 'document', 'doctools']],
835  ['name' => 'others'],
836  '/',
837  ['name' => 'basicstyles', 'groups' => ['basicstyles', 'align', 'cleanup']],
838  ['name' => 'document', 'groups' => ['list', 'indent', 'blocks', 'align', 'bidi']],
839  ['name' => 'specialcharacters', 'groups' => ['insertcharacters']],
840  '/',
841  ['name' => 'styles'],
842  ],
843  ],
844  ],
845  ],
846  [
847  'editor' => [
848  'config' => [
849  'toolbar' => [
850  'items' => [
851  'undo',
852  'redo',
853  '|',
854  'findAndReplace',
855  '|',
856  'selectAll',
857  '|',
858  'link',
859  '|',
860  'insertImage',
861  'insertTable',
862  'horizontalLine',
863  'specialCharacters',
864  'pageBreak',
865  '|',
866  'sourceEditing',
867  '-',
868  'bold',
869  'italic',
870  'underline',
871  'strikethrough',
872  'subscript',
873  'superscript',
874  'softhyphen',
875  '|',
876  'alignment:left',
877  'alignment:center',
878  'alignment:right',
879  'alignment:justify',
880  '|',
881  'removeFormat',
882  '|',
883  'numberedList',
884  'bulletedList',
885  '|',
886  'indent',
887  'outdent',
888  '|',
889  'blockQuote',
890  '|',
891  'textPartLanguage',
892  '|',
893  'insertcharacters',
894  '-',
895  'style',
896  'heading',
897  'fontFamily',
898  'fontSize',
899  ],
900  'removeItems' => [],
901  'shouldNotGroupWhenFull' => true,
902  ],
903  'alignment' => [
904  'options' => [
905  ['name' => 'left', 'className' => 'text-start'],
906  ['name' => 'center', 'className' => 'text-center'],
907  ['name' => 'right', 'className' => 'text-end'],
908  ['name' => 'justify', 'className' => 'text-justify'],
909  ],
910  ],
911  'wordCount' => [
912  'displayCharacters' => true,
913  'displayWords' => true,
914  ],
915  ],
916  ],
917  ],
918  ],
919  'CKEditor4 Toolbar Minimal' => [
920  [
921  'editor' => [
922  'config' => [
923  'toolbarGroups' => [
924  ['name' => 'basicstyles', 'groups' => ['basicstyles']],
925  ['name' => 'clipboard', 'groups' => ['clipboard', 'undo']],
926  ],
927  ],
928  ],
929  ],
930  [
931  'editor' => [
932  'config' => [
933  'toolbar' => [
934  'items' => [
935  'bold',
936  'italic',
937  'underline',
938  'strikethrough',
939  'subscript',
940  'superscript',
941  'softhyphen',
942  '|',
943  'undo',
944  'redo',
945  ],
946  'removeItems' => [],
947  'shouldNotGroupWhenFull' => true,
948  ],
949  'alignment' => [
950  'options' => [
951  ['name' => 'left', 'className' => 'text-start'],
952  ['name' => 'center', 'className' => 'text-center'],
953  ['name' => 'right', 'className' => 'text-end'],
954  ['name' => 'justify', 'className' => 'text-justify'],
955  ],
956  ],
957  'wordCount' => [
958  'displayCharacters' => true,
959  'displayWords' => true,
960  ],
961  ],
962  ],
963  ],
964  ],
965  'Migrate contentsCss to array' => [
966  [
967  'editor' => [
968  'config' => [
969  'contentsCss' => 'EXT:example/Resources/Public/Css/ckeditor.css',
970  ],
971  ],
972  ],
973  [
974  'editor' => [
975  'config' => [
976  'contentsCss' => [
977  'EXT:example/Resources/Public/Css/ckeditor.css',
978  ],
979  'toolbar' => [
980  'items' => [
981  'softhyphen',
982  ],
983  'removeItems' => [],
984  'shouldNotGroupWhenFull' => true,
985  ],
986  'alignment' => [
987  'options' => [
988  ['name' => 'left', 'className' => 'text-start'],
989  ['name' => 'center', 'className' => 'text-center'],
990  ['name' => 'right', 'className' => 'text-end'],
991  ['name' => 'justify', 'className' => 'text-justify'],
992  ],
993  ],
994  'wordCount' => [
995  'displayCharacters' => true,
996  'displayWords' => true,
997  ],
998  ],
999  ],
1000  ],
1001  ],
1002  'Remove contentsCss if empty' => [
1003  [
1004  'editor' => [
1005  'config' => [
1006  'contentsCss' => '',
1007  ],
1008  ],
1009  ],
1010  [
1011  'editor' => [
1012  'config' => [
1013  'toolbar' => [
1014  'items' => [
1015  'softhyphen',
1016  ],
1017  'removeItems' => [],
1018  'shouldNotGroupWhenFull' => true,
1019  ],
1020  'alignment' => [
1021  'options' => [
1022  ['name' => 'left', 'className' => 'text-start'],
1023  ['name' => 'center', 'className' => 'text-center'],
1024  ['name' => 'right', 'className' => 'text-end'],
1025  ['name' => 'justify', 'className' => 'text-justify'],
1026  ],
1027  ],
1028  'wordCount' => [
1029  'displayCharacters' => true,
1030  'displayWords' => true,
1031  ],
1032  ],
1033  ],
1034  ],
1035  ],
1036  'Migrate contentsCss to a clean array with mixed values' => [
1037  [
1038  'editor' => [
1039  'config' => [
1040  'contentsCss' => [
1041  'EXT:example/Resources/Public/Css/ckeditor.css ', // trailing whitespaces are on purpose
1042  '',
1043  'EXT:example/Resources/Public/Css/ckeditor2.css',
1044  42,
1045  ],
1046  ],
1047  ],
1048  ],
1049  [
1050  'editor' => [
1051  'config' => [
1052  'contentsCss' => [
1053  'EXT:example/Resources/Public/Css/ckeditor.css',
1054  'EXT:example/Resources/Public/Css/ckeditor2.css',
1055  ],
1056  'toolbar' => [
1057  'items' => [
1058  'softhyphen',
1059  ],
1060  'removeItems' => [],
1061  'shouldNotGroupWhenFull' => true,
1062  ],
1063  'alignment' => [
1064  'options' => [
1065  ['name' => 'left', 'className' => 'text-start'],
1066  ['name' => 'center', 'className' => 'text-center'],
1067  ['name' => 'right', 'className' => 'text-end'],
1068  ['name' => 'justify', 'className' => 'text-justify'],
1069  ],
1070  ],
1071  'wordCount' => [
1072  'displayCharacters' => true,
1073  'displayWords' => true,
1074  ],
1075  ],
1076  ],
1077  ],
1078  ],
1079 
1080  // typo3link.additionalAttributes
1081  'Migrate typo3link.additionalAttributes to config.htmlSupport' => [
1082  [
1083  'editor' => [
1084  'config' => [
1085  'typo3link' => [
1086  'additionalAttributes' => [
1087  'foo',
1088  'bar',
1089  ],
1090  ],
1091  ],
1092  ],
1093  ],
1094  [
1095  'editor' => [
1096  'config' => [
1097  'htmlSupport' => [
1098  'allow' => [
1099  [
1100  'name' => 'a',
1101  'attributes' => [
1102  'foo',
1103  'bar',
1104  ],
1105  ],
1106  ],
1107  ],
1108  'toolbar' => [
1109  'items' => [
1110  'softhyphen',
1111  ],
1112  'removeItems' => [],
1113  'shouldNotGroupWhenFull' => true,
1114  ],
1115  'alignment' => [
1116  'options' => [
1117  ['name' => 'left', 'className' => 'text-start'],
1118  ['name' => 'center', 'className' => 'text-center'],
1119  ['name' => 'right', 'className' => 'text-end'],
1120  ['name' => 'justify', 'className' => 'text-justify'],
1121  ],
1122  ],
1123  'wordCount' => [
1124  'displayCharacters' => true,
1125  'displayWords' => true,
1126  ],
1127  ],
1128  ],
1129  ],
1130  ],
1131  'Unset empty typo3link.additionalAttributes' => [
1132  [
1133  'editor' => [
1134  'config' => [
1135  'typo3link' => [
1136  'additionalAttributes' => [],
1137  ],
1138  ],
1139  ],
1140  ],
1141  [
1142  'editor' => [
1143  'config' => [
1144  'toolbar' => [
1145  'items' => [
1146  'softhyphen',
1147  ],
1148  'removeItems' => [],
1149  'shouldNotGroupWhenFull' => true,
1150  ],
1151  'alignment' => [
1152  'options' => [
1153  ['name' => 'left', 'className' => 'text-start'],
1154  ['name' => 'center', 'className' => 'text-center'],
1155  ['name' => 'right', 'className' => 'text-end'],
1156  ['name' => 'justify', 'className' => 'text-justify'],
1157  ],
1158  ],
1159  'wordCount' => [
1160  'displayCharacters' => true,
1161  'displayWords' => true,
1162  ],
1163  ],
1164  ],
1165  ],
1166  ],
1167  'Unset invalid values in typo3link.additionalAttributes' => [
1168  [
1169  'editor' => [
1170  'config' => [
1171  'typo3link' => [
1172  'additionalAttributes' => 'invalid string value',
1173  ],
1174  ],
1175  ],
1176  ],
1177  [
1178  'editor' => [
1179  'config' => [
1180  'toolbar' => [
1181  'items' => [
1182  'softhyphen',
1183  ],
1184  'removeItems' => [],
1185  'shouldNotGroupWhenFull' => true,
1186  ],
1187  'alignment' => [
1188  'options' => [
1189  ['name' => 'left', 'className' => 'text-start'],
1190  ['name' => 'center', 'className' => 'text-center'],
1191  ['name' => 'right', 'className' => 'text-end'],
1192  ['name' => 'justify', 'className' => 'text-justify'],
1193  ],
1194  ],
1195  'wordCount' => [
1196  'displayCharacters' => true,
1197  'displayWords' => true,
1198  ],
1199  ],
1200  ],
1201  ],
1202  ],
1203  // {extraA,disa,a}allowedContent
1204  'Migrate {extraA,disa,a}allowedContent from string representation to config.htmlSupport' => [
1205  [
1206  'editor' => [
1207  'config' => [
1208  'extraAllowedContent' => 'div[aria-label,data-*];a(classname)',
1209  'allowedContent' => '*[*](*){*}',
1210  'disallowedContent' => 'strong underline;em[*](*){*}',
1211  ],
1212  ],
1213  ],
1214  [
1215  'editor' => [
1216  'config' => [
1217  'htmlSupport' => [
1218  'allow' => [
1219  [
1220  'name' => [
1221  'pattern' => '^[a-z]+$',
1222  ],
1223  'classes' => true,
1224  'attributes' => true,
1225  'styles' => true,
1226  ],
1227  [
1228  'name' => 'div',
1229  'attributes' => [
1230  'aria-label',
1231  [
1232  'pattern' => 'data-.+',
1233  ],
1234  ],
1235  ],
1236  [
1237  'name' => 'a',
1238  'classes' => [
1239  'classname',
1240  ],
1241  ],
1242  ],
1243  'disallow' => [
1244  [
1245  'name' => [
1246  'pattern' => 'strong|underline',
1247  ],
1248  ],
1249  [
1250  'name' => 'em',
1251  'classes' => true,
1252  'attributes' => true,
1253  'styles' => true,
1254  ],
1255  ],
1256  ],
1257  'toolbar' => [
1258  'items' => [
1259  'softhyphen',
1260  ],
1261  'removeItems' => [],
1262  'shouldNotGroupWhenFull' => true,
1263  ],
1264  'alignment' => [
1265  'options' => [
1266  ['name' => 'left', 'className' => 'text-start'],
1267  ['name' => 'center', 'className' => 'text-center'],
1268  ['name' => 'right', 'className' => 'text-end'],
1269  ['name' => 'justify', 'className' => 'text-justify'],
1270  ],
1271  ],
1272  'wordCount' => [
1273  'displayCharacters' => true,
1274  'displayWords' => true,
1275  ],
1276  ],
1277  ],
1278  ],
1279  ],
1280  // {extraA,disa,a}allowedContent
1281  'Migrate {extraA,disa,a}allowedContent from object representation to config.htmlSupport' => [
1282  [
1283  'editor' => [
1284  'config' => [
1285  'extraAllowedContent' => [
1286  'div' => [
1287  'attributes' => 'aria-label,data-*',
1288  ],
1289  'a' => [
1290  'classes' => 'classname',
1291  ],
1292  ],
1293  'allowedContent' => [
1294  '*' => [
1295  'styles' => '*',
1296  'classes' => '*',
1297  'attributes' => '*',
1298  ],
1299  ],
1300  'disallowedContent' => [
1301  'strong underline' => true,
1302  'em' => [
1303  'styles' => '*',
1304  'classes' => '*',
1305  'attributes' => '*',
1306  ],
1307  ],
1308  ],
1309  ],
1310  ],
1311  [
1312  'editor' => [
1313  'config' => [
1314  'htmlSupport' => [
1315  'allow' => [
1316  [
1317  'name' => [
1318  'pattern' => '^[a-z]+$',
1319  ],
1320  'classes' => true,
1321  'attributes' => true,
1322  'styles' => true,
1323  ],
1324  [
1325  'name' => 'div',
1326  'attributes' => [
1327  'aria-label',
1328  [
1329  'pattern' => 'data-.+',
1330  ],
1331  ],
1332  ],
1333  [
1334  'name' => 'a',
1335  'classes' => [
1336  'classname',
1337  ],
1338  ],
1339  ],
1340  'disallow' => [
1341  [
1342  'name' => [
1343  'pattern' => 'strong|underline',
1344  ],
1345  ],
1346  [
1347  'name' => 'em',
1348  'classes' => true,
1349  'attributes' => true,
1350  'styles' => true,
1351  ],
1352  ],
1353  ],
1354  'toolbar' => [
1355  'items' => [
1356  'softhyphen',
1357  ],
1358  'removeItems' => [],
1359  'shouldNotGroupWhenFull' => true,
1360  ],
1361  'alignment' => [
1362  'options' => [
1363  ['name' => 'left', 'className' => 'text-start'],
1364  ['name' => 'center', 'className' => 'text-center'],
1365  ['name' => 'right', 'className' => 'text-end'],
1366  ['name' => 'justify', 'className' => 'text-justify'],
1367  ],
1368  ],
1369  'wordCount' => [
1370  'displayCharacters' => true,
1371  'displayWords' => true,
1372  ],
1373  ],
1374  ],
1375  ],
1376  ],
1377 
1378  // Plugin Alignment Handling
1379  'Remove Alignment Plugin' => [
1380  [
1381  'editor' => [
1382  'config' => [
1383  'removePlugins' => ['Alignment'],
1384  ],
1385  ],
1386  ],
1387  [
1388  'editor' => [
1389  'config' => [
1390  'removeImportModules' => [
1391  [
1392  'module' => '@ckeditor/ckeditor5-alignment',
1393  'exports' => [ 'Alignment' ],
1394  ],
1395  ],
1396  'toolbar' => [
1397  'items' => [
1398  'softhyphen',
1399  ],
1400  'removeItems' => [
1401  'alignment',
1402  'alignment:left',
1403  'alignment:right',
1404  'alignment:center',
1405  'alignment:justify',
1406  ],
1407  'shouldNotGroupWhenFull' => true,
1408  ],
1409  'wordCount' => [
1410  'displayCharacters' => true,
1411  'displayWords' => true,
1412  ],
1413  ],
1414  ],
1415  ],
1416  ],
1417  'Configure Alignment like CKEditor4' => [
1418  [
1419  'editor' => [
1420  'config' => [
1421  'justifyClasses' => [
1422  'left',
1423  'center',
1424  'right',
1425  'justify',
1426  ],
1427  ],
1428  ],
1429  ],
1430  [
1431  'editor' => [
1432  'config' => [
1433  'toolbar' => [
1434  'items' => [
1435  'softhyphen',
1436  ],
1437  'removeItems' => [],
1438  'shouldNotGroupWhenFull' => true,
1439  ],
1440  'alignment' => [
1441  'options' => [
1442  ['name' => 'left', 'className' => 'left'],
1443  ['name' => 'center', 'className' => 'center'],
1444  ['name' => 'right', 'className' => 'right'],
1445  ['name' => 'justify', 'className' => 'justify'],
1446  ],
1447  ],
1448  'wordCount' => [
1449  'displayCharacters' => true,
1450  'displayWords' => true,
1451  ],
1452  ],
1453  ],
1454  ],
1455  ],
1456  'Configure Alignment like CKEditor4 Partially' => [
1457  [
1458  'editor' => [
1459  'config' => [
1460  'justifyClasses' => [
1461  'left',
1462  'center',
1463  ],
1464  ],
1465  ],
1466  ],
1467  [
1468  'editor' => [
1469  'config' => [
1470  'toolbar' => [
1471  'items' => [
1472  'softhyphen',
1473  ],
1474  'removeItems' => [],
1475  'shouldNotGroupWhenFull' => true,
1476  ],
1477  'alignment' => [
1478  'options' => [
1479  ['name' => 'left', 'className' => 'left'],
1480  ['name' => 'center', 'className' => 'center'],
1481  ['name' => 'right', 'className' => 'text-end'],
1482  ['name' => 'justify', 'className' => 'text-justify'],
1483  ],
1484  ],
1485  'wordCount' => [
1486  'displayCharacters' => true,
1487  'displayWords' => true,
1488  ],
1489  ],
1490  ],
1491  ],
1492  ],
1493  'Configure Alignment like CKEditor5' => [
1494  [
1495  'editor' => [
1496  'config' => [
1497  'alignment' => [
1498  'options' => [
1499  ['name' => 'left', 'className' => 'left'],
1500  ['name' => 'center', 'className' => 'center'],
1501  ['name' => 'right', 'className' => 'right'],
1502  ['name' => 'justify', 'className' => 'justify'],
1503  ],
1504  ],
1505  ],
1506  ],
1507  ],
1508  [
1509  'editor' => [
1510  'config' => [
1511  'toolbar' => [
1512  'items' => [
1513  'softhyphen',
1514  ],
1515  'removeItems' => [],
1516  'shouldNotGroupWhenFull' => true,
1517  ],
1518  'alignment' => [
1519  'options' => [
1520  ['name' => 'left', 'className' => 'left'],
1521  ['name' => 'center', 'className' => 'center'],
1522  ['name' => 'right', 'className' => 'right'],
1523  ['name' => 'justify', 'className' => 'justify'],
1524  ],
1525  ],
1526  'wordCount' => [
1527  'displayCharacters' => true,
1528  'displayWords' => true,
1529  ],
1530  ],
1531  ],
1532  ],
1533  ],
1534  'Configure Alignment like CKEditor5 Partially' => [
1535  [
1536  'editor' => [
1537  'config' => [
1538  'alignment' => [
1539  'options' => [
1540  ['name' => 'center', 'className' => 'center'],
1541  ['name' => 'justify', 'className' => 'justify'],
1542  ],
1543  ],
1544  ],
1545  ],
1546  ],
1547  [
1548  'editor' => [
1549  'config' => [
1550  'toolbar' => [
1551  'items' => [
1552  'softhyphen',
1553  ],
1554  'removeItems' => [],
1555  'shouldNotGroupWhenFull' => true,
1556  ],
1557  'alignment' => [
1558  'options' => [
1559  ['name' => 'left', 'className' => 'text-start'],
1560  ['name' => 'center', 'className' => 'center'],
1561  ['name' => 'right', 'className' => 'text-end'],
1562  ['name' => 'justify', 'className' => 'justify'],
1563  ],
1564  ],
1565  'wordCount' => [
1566  'displayCharacters' => true,
1567  'displayWords' => true,
1568  ],
1569  ],
1570  ],
1571  ],
1572  ],
1573 
1574  // Plugin Whitespace Handling
1575  'Remove Whitespace Plugin' => [
1576  [
1577  'editor' => [
1578  'config' => [
1579  'removePlugins' => [
1580  'Whitespace',
1581  ],
1582  ],
1583  ],
1584  ],
1585  [
1586  'editor' => [
1587  'config' => [
1588  'removeImportModules' => [
1589  [
1590  'module' => '@typo3/rte-ckeditor/plugin/whitespace.js',
1591  'exports' => [ 'Whitespace' ],
1592  ],
1593  ],
1594  'toolbar' => [
1595  'items' => [],
1596  'removeItems' => [
1597  'softhyphen',
1598  ],
1599  'shouldNotGroupWhenFull' => true,
1600  ],
1601  'alignment' => [
1602  'options' => [
1603  ['name' => 'left', 'className' => 'text-start'],
1604  ['name' => 'center', 'className' => 'text-center'],
1605  ['name' => 'right', 'className' => 'text-end'],
1606  ['name' => 'justify', 'className' => 'text-justify'],
1607  ],
1608  ],
1609  'wordCount' => [
1610  'displayCharacters' => true,
1611  'displayWords' => true,
1612  ],
1613  ],
1614  ],
1615  ],
1616  ],
1617  'Remove Whitespace Plugin (Legacy Name)' => [
1618  [
1619  'editor' => [
1620  'config' => [
1621  'removePlugins' => [
1622  'softhyphen',
1623  ],
1624  ],
1625  ],
1626  ],
1627  [
1628  'editor' => [
1629  'config' => [
1630  'removeImportModules' => [
1631  [
1632  'module' => '@typo3/rte-ckeditor/plugin/whitespace.js',
1633  'exports' => [ 'Whitespace' ],
1634  ],
1635  ],
1636  'toolbar' => [
1637  'items' => [],
1638  'removeItems' => [
1639  'softhyphen',
1640  ],
1641  'shouldNotGroupWhenFull' => true,
1642  ],
1643  'alignment' => [
1644  'options' => [
1645  ['name' => 'left', 'className' => 'text-start'],
1646  ['name' => 'center', 'className' => 'text-center'],
1647  ['name' => 'right', 'className' => 'text-end'],
1648  ['name' => 'justify', 'className' => 'text-justify'],
1649  ],
1650  ],
1651  'wordCount' => [
1652  'displayCharacters' => true,
1653  'displayWords' => true,
1654  ],
1655  ],
1656  ],
1657  ],
1658  ],
1659  'Toolbaritem softhyphen not added when exists in toolbar' => [
1660  [
1661  'editor' => [
1662  'config' => [
1663  'toolbar' => [
1664  'items' => [
1665  'softhyphen',
1666  'bold',
1667  ],
1668  ],
1669  ],
1670  ],
1671  ],
1672  [
1673  'editor' => [
1674  'config' => [
1675  'toolbar' => [
1676  'items' => [
1677  'softhyphen',
1678  'bold',
1679  ],
1680  'removeItems' => [],
1681  'shouldNotGroupWhenFull' => true,
1682  ],
1683  'alignment' => [
1684  'options' => [
1685  ['name' => 'left', 'className' => 'text-start'],
1686  ['name' => 'center', 'className' => 'text-center'],
1687  ['name' => 'right', 'className' => 'text-end'],
1688  ['name' => 'justify', 'className' => 'text-justify'],
1689  ],
1690  ],
1691  'wordCount' => [
1692  'displayCharacters' => true,
1693  'displayWords' => true,
1694  ],
1695  ],
1696  ],
1697  ],
1698  ],
1699 
1700  // Plugin WordCount Handling
1701  'Remove WordCount Plugin' => [
1702  [
1703  'editor' => [
1704  'config' => [
1705  'removePlugins' => ['WordCount'],
1706  ],
1707  ],
1708  ],
1709  [
1710  'editor' => [
1711  'config' => [
1712  'removeImportModules' => [
1713  [
1714  'module' => '@ckeditor/ckeditor5-word-count',
1715  'exports' => [ 'WordCount' ],
1716  ],
1717  ],
1718  'toolbar' => [
1719  'items' => [
1720  'softhyphen',
1721  ],
1722  'removeItems' => [],
1723  'shouldNotGroupWhenFull' => true,
1724  ],
1725  'alignment' => [
1726  'options' => [
1727  ['name' => 'left', 'className' => 'text-start'],
1728  ['name' => 'center', 'className' => 'text-center'],
1729  ['name' => 'right', 'className' => 'text-end'],
1730  ['name' => 'justify', 'className' => 'text-justify'],
1731  ],
1732  ],
1733  ],
1734  ],
1735  ],
1736  ],
1737  'Configure WordCount like CKEditor4' => [
1738  [
1739  'editor' => [
1740  'config' => [
1741  'wordcount' => [
1742  'showCharCount' => false,
1743  'showWordCount' => false,
1744  ],
1745  ],
1746  ],
1747  ],
1748  [
1749  'editor' => [
1750  'config' => [
1751  'toolbar' => [
1752  'items' => [
1753  'softhyphen',
1754  ],
1755  'removeItems' => [],
1756  'shouldNotGroupWhenFull' => true,
1757  ],
1758  'alignment' => [
1759  'options' => [
1760  ['name' => 'left', 'className' => 'text-start'],
1761  ['name' => 'center', 'className' => 'text-center'],
1762  ['name' => 'right', 'className' => 'text-end'],
1763  ['name' => 'justify', 'className' => 'text-justify'],
1764  ],
1765  ],
1766  'wordCount' => [
1767  'displayCharacters' => false,
1768  'displayWords' => false,
1769  ],
1770  ],
1771  ],
1772  ],
1773  ],
1774  'Configure WordCount like CKEditor4 Partially' => [
1775  [
1776  'editor' => [
1777  'config' => [
1778  'wordcount' => [
1779  'showCharCount' => false,
1780  ],
1781  ],
1782  ],
1783 
1784  ],
1785  [
1786  'editor' => [
1787  'config' => [
1788  'toolbar' => [
1789  'items' => [
1790  'softhyphen',
1791  ],
1792  'removeItems' => [],
1793  'shouldNotGroupWhenFull' => true,
1794  ],
1795  'alignment' => [
1796  'options' => [
1797  ['name' => 'left', 'className' => 'text-start'],
1798  ['name' => 'center', 'className' => 'text-center'],
1799  ['name' => 'right', 'className' => 'text-end'],
1800  ['name' => 'justify', 'className' => 'text-justify'],
1801  ],
1802  ],
1803  'wordCount' => [
1804  'displayCharacters' => false,
1805  'displayWords' => true,
1806  ],
1807  ],
1808  ],
1809  ],
1810  ],
1811  'Configure WordCount like CKEditor5' => [
1812  [
1813  'editor' => [
1814  'config' => [
1815  'wordCount' => [
1816  'displayCharacters' => false,
1817  'displayWords' => false,
1818  ],
1819  ],
1820  ],
1821  ],
1822  [
1823  'editor' => [
1824  'config' => [
1825  'toolbar' => [
1826  'items' => [
1827  'softhyphen',
1828  ],
1829  'removeItems' => [],
1830  'shouldNotGroupWhenFull' => true,
1831  ],
1832  'alignment' => [
1833  'options' => [
1834  ['name' => 'left', 'className' => 'text-start'],
1835  ['name' => 'center', 'className' => 'text-center'],
1836  ['name' => 'right', 'className' => 'text-end'],
1837  ['name' => 'justify', 'className' => 'text-justify'],
1838  ],
1839  ],
1840  'wordCount' => [
1841  'displayCharacters' => false,
1842  'displayWords' => false,
1843  ],
1844  ],
1845  ],
1846  ],
1847  ],
1848  'Configure WordCount like CKEditor5 Partially' => [
1849  [
1850  'editor' => [
1851  'config' => [
1852  'wordCount' => [
1853  'displayCharacters' => false,
1854  ],
1855  ],
1856  ],
1857  ],
1858  [
1859  'editor' => [
1860  'config' => [
1861  'toolbar' => [
1862  'items' => [
1863  'softhyphen',
1864  ],
1865  'removeItems' => [],
1866  'shouldNotGroupWhenFull' => true,
1867  ],
1868  'alignment' => [
1869  'options' => [
1870  ['name' => 'left', 'className' => 'text-start'],
1871  ['name' => 'center', 'className' => 'text-center'],
1872  ['name' => 'right', 'className' => 'text-end'],
1873  ['name' => 'justify', 'className' => 'text-justify'],
1874  ],
1875  ],
1876  'wordCount' => [
1877  'displayCharacters' => false,
1878  'displayWords' => true,
1879  ],
1880  ],
1881  ],
1882  ],
1883  ],
1884 
1885  // Add link classes to ckeditor styles
1886  'Add missing link classes to ckeditor styles' => [
1887  [
1888  'editor' => [
1889  'config' => [
1890  'style' => [
1891  'definitions' => [
1892  [
1893  'classes' => ['link-arrow'],
1894  'element' => 'a',
1895  'name' => 'Link Arrow',
1896  ],
1897  [
1898  'classes' => ['class-karl'],
1899  'element' => 'p',
1900  'name' => 'Class Karl',
1901  ],
1902  ],
1903  ],
1904  ],
1905  ],
1906  'buttons' => [
1907  'link' => [
1908  'properties' => [
1909  'class' => [
1910  'allowedClasses' => 'link-arrow, btn btn-default, link-chevron, class-karl',
1911  ],
1912  ],
1913  ],
1914  ],
1915  ],
1916  [
1917  'editor' => [
1918  'config' => [
1919  'style' => [
1920  'definitions' => [
1921  [
1922  'classes' => ['link-arrow'],
1923  'element' => 'a',
1924  'name' => 'Link Arrow',
1925  ],
1926  [
1927  'classes' => ['btn', 'btn-default'],
1928  'element' => 'a',
1929  'name' => 'btn btn-default',
1930  ],
1931  [
1932  'classes' => ['link-chevron'],
1933  'element' => 'a',
1934  'name' => 'link-chevron',
1935  ],
1936  [
1937  'classes' => ['class-karl'],
1938  'element' => 'a',
1939  'name' => 'class-karl',
1940  ],
1941  [
1942  'classes' => ['class-karl'],
1943  'element' => 'p',
1944  'name' => 'Class Karl',
1945  ],
1946  ],
1947  ],
1948  'toolbar' => [
1949  'items' => [
1950  'softhyphen',
1951  ],
1952  'removeItems' => [],
1953  'shouldNotGroupWhenFull' => true,
1954  ],
1955  'alignment' => [
1956  'options' => [
1957  ['name' => 'left', 'className' => 'text-start'],
1958  ['name' => 'center', 'className' => 'text-center'],
1959  ['name' => 'right', 'className' => 'text-end'],
1960  ['name' => 'justify', 'className' => 'text-justify'],
1961  ],
1962  ],
1963  'wordCount' => [
1964  'displayCharacters' => true,
1965  'displayWords' => true,
1966  ],
1967  ],
1968  ],
1969  'buttons' => [
1970  'link' => [
1971  'properties' => [
1972  'class' => [
1973  'allowedClasses' => 'link-arrow, btn btn-default, link-chevron, class-karl',
1974  ],
1975  ],
1976  ],
1977  ],
1978  ],
1979  ],
1980  ];
1981  }
1982 
1983  #[DataProvider('migrationDataProvider')]
1984  #[Test]
1985  public function ‪migrationTests(array $configuration, array $expectation): void
1986  {
1987  $finalConfiguration = GeneralUtility::makeInstance(
1988  CKEditor5Migrator::class,
1989  $configuration
1990  )->get();
1991  self::assertEquals($expectation, $finalConfiguration);
1992  }
1993 }
‪TYPO3\CMS\Core\Tests\Unit\Configuration\CKEditor5MigratorTest\migrationTests
‪migrationTests(array $configuration, array $expectation)
Definition: CKEditor5MigratorTest.php:1985
‪TYPO3\CMS\Core\Tests\Unit\Configuration\CKEditor5MigratorTest\migrationDataProvider
‪static migrationDataProvider()
Definition: CKEditor5MigratorTest.php:28
‪TYPO3\CMS\Core\Tests\Unit\Configuration\CKEditor5MigratorTest
Definition: CKEditor5MigratorTest.php:27
‪TYPO3\CMS\Core\Configuration\CKEditor5Migrator
Definition: CKEditor5Migrator.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\Tests\Unit\Configuration
Definition: CKEditor5MigratorTest.php:18